-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTML Beautify: do not format YAML front matter #510
Comments
There are so many of the templating systems the people what to use with js, html, and css. |
Short of dramatically refactoring with a robust AST parser (e.g., Esprima), providing a plugin interface to allow custom poking of such an AST, and thus abandoning the Python version, I don't see this happening. (And almost all of the AST code generators, like escodegen, produce output that is extremely difficult to customize) To be perhaps a little more blunt, this project should not do anything more than beautify JS. Notice I left out HTML and CSS, but if they must remain, then they should only beautify CSS and HTML. It is time-wasting folly to attempt to contort our static parser to allow for every pre- and post-processor's malformed "sugar" of syntax. We don't beautify YAML, nor Markdown/LESS/SASS/React/Go/Ruby/Brainfuck for that matter. Curmudgeonliness aside, the encroaching complexity of supporting every weird meta-syntax fever dreamt by our strange beautiful community of front-end craftspeople is just loony. There are other beautifiers, today, that do attempt to engage the AST angle (though the plugin APIs, if they exist at all, tend to be very immature). |
Very reasonable. Same principle as "beautifier is not a general purpose formatter". The js beautifier provides an easy api for wrapping it inside another beautifier. That is exactly what the html beautifier does. When it encounters javascript, the html beautifier passes control to the js beautifier and then integrates the output. People are welcome to wrap or modify the components provided by this project to create their own. If people are interested and willing to take/share responsibility, they could make their projects part of beautify-web. In the short-term, we should probably start marking bug requests based outside of html, css, and javascript, and then decide where to go from there. |
I do believe that beautifier should have a parameter like <p>
This is multiple
line text, that is
easy to read in
MC
</p> 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. |
Static 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:
converts to:
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/
The text was updated successfully, but these errors were encountered: