Open logansullivan opened 7 years ago
The challenge with Freemarker is that it is forgiving with syntax violations. In the case of your samples the <#assign>
tags should be self-closing: <#assign variable=value/>
. Currently, they aren't self closing and so the beautifiers think they are opening tags. There are other weird syntax forgiveness things that Freemarker does that I cannot think about off the top of my head.
JS Beautify, which supports HTML beautification very well, claims to provide no XML support, so use it at your own risk. Pretty Diff does provide support for XML and is the official XML beautifier used in Atom Beautify, so you sure switch your beautifier to Pretty Diff for HTML or change the language in Atom settings from HTML to XML.
I will need to enhance Pretty Diff to work around these Freemarker quirks to order for it to beautify correctly. I really should do this since I am stuck using Freemarker at work anyways.
Thanks for the self closing tip that is very helpful. Ya I am stuck using Freemarker at work as well, Thanks for your efforts in looking into this! Would be super awesome if it accepted the .ftl format but I know that is a long stretch. : )
Description
When using the Atom Beautifcation tools for Freemarker templates set as .html parts of the code is getting random spaces added.
Input Before Beautification
This is what the code looked like before:
Expected Output
The beautified code should have looked like this:
Actual Output
The beautified code actually looked like this:
Steps to Reproduce
Atom Beautify: Beautify Editor
Debug
Here is a link to the
debug.md
Gist: https://gist.github.com/logansullivan/d25812ffb4d55f6369c1349a3ea42675Checklist
I have:
debug.md
Gist to this issue