Support dynamic languages in front matter (#8381)
This commit is contained in:
1 parent
8718bb4be4
commit
44bae94647
20 files changed
+203
-39
No files matched your search
@@ -0,0 +1,31 @@
|
||||
#### Support front matter with dynamic language ([#8381](https://github.com/prettier/prettier/pull/8381) by [@fisker](https://github.com/fisker))
|
||||
|
||||
Support [dynamic language detection](https://github.com/jonschlinkert/gray-matter#optionslanguage) in front matter, also available for `css`, `less`, `scss`, and `markdown` parser.
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```html
|
||||
<!-- Input -->
|
||||
---my-awsome-language
|
||||
title: Title
|
||||
description: Description
|
||||
---
|
||||
<h1>
|
||||
prettier</h1>
|
||||
|
||||
<!-- Prettier stable -->
|
||||
---my-awsome-language title: Title description: Description ---
|
||||
|
||||
<h1>
|
||||
prettier
|
||||
</h1>
|
||||
|
||||
<!-- Prettier master -->
|
||||
---my-awsome-language
|
||||
title: Title
|
||||
description: Description
|
||||
---
|
||||
|
||||
<h1>
|
||||
prettier
|
||||
</h1>
|
||||
```
|
||||
Reference in new issue
Block a user