HTML Beautify: do not format YAML front matter
See original GitHub issueStatic site generators like Assemble or Middleman or Jekyll are supporting YAML front matter at the top of a template. When running html beautify on these templates, the front matter gets messed up.
So this yaml front matter:
---
title: Test
is-test: true
---
converts to:
--- title: Test is-test: true ---
I would suggest to ignore everything “wrapped” between three dashes or to add an extra option.
Further information: http://assemble.io/docs/YAML.html or http://middlemanapp.com/basics/frontmatter/
Issue Analytics
- State:
- Created 9 years ago
- Reactions:2
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Code formatting break Jekyll YAML front matter directives in ...
To resolve this, you have two options: Turned off formatting of HTML files in settings.json file: "html.format.enable": false.
Read more >Prettier 1.15: HTML, Vue, Angular and MDX Support
Prettier can now format HTML, Vue and Angular files! ... Do not print wrong output if both front matter and /* prettier-ignore */...
Read more >Markdown YAML front matter, Jekyll formatter, Md front matter, Jekyll ...
A YAML frontmatter, in Pandoc's terms "metadata block" is a series of meta variables that can be defined to describe information of the...
Read more >YAML front matter - Assemble.io
This may not be obvious at first, is that YAML Front-Matter acts as a kind of "conduit" for passing information to pages via...
Read more >tidy-markdown - npm
Format YAML front -matter and Markdown tables. Convert HTML elements into their Markdown equivalents. For example, <em>text</em> becomes _text_ .
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I do believe that beautifier should have a parameter like
preservenewlines
. If it already have it then preserve new lines in the text. It is not only issue of front matter. For example let’s say there is HTML code and some people work in VS Code and other in MidnightCommander right on the server. that is why all text is formatted like this.This works right when HTML is rendered and also visible in MC. But if someone format it with beautifier this is gone.
So preserve new lines in the text would be awesome.
I think this is fixed. Just needs a test.