You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When formatting HTML files that includes XML tags, such as <svg>, I've noticed it doesn't format the contents of <svg>. Since <svg> is part of XML, it is not supported for js-beautify.
However, since the XML tag is inside an HTML file, should those also need supporting for HTML formatting?
I was told to file an issue here instead of VS Code, since they said any formatting issues should be redirected to the js-beautify project.
Input
The code looked like this before beautification:
<p class="newListItem">
<svg height="40" width="40">
<circle cx="20" cy="20" r="18" stroke="black" stroke-width="0" fill="#bddffa" />
<text x="50%" y="50%" text-anchor="middle" stroke="#1b97f3" stroke-width="2px" dy=".3em">1</text>
</svg> This is a paragraph after an SVG shape.
</p>
Expected Output
The code should have looked like this after beautification:
<p class="newListItem">
<svg height="40" width="40">
<circle cx="20" cy="20" r="18" stroke="black" stroke-width="0" fill="#bddffa" />
<text x="50%" y="50%" text-anchor="middle" stroke="#1b97f3" stroke-width="2px" dy=".3em">1</text>
</svg>
This is a paragraph after an SVG shape.
</p>
Actual Output
The code actually looked like this after beautification:
<p class="newListItem">
<svg height="40" width="40">
<circle cx="20" cy="20" r="18" stroke="black" stroke-width="0" fill="#bddffa" />
<text x="50%" y="50%" text-anchor="middle" stroke="#1b97f3" stroke-width="2px" dy=".3em">1</text>
</svg> This is a paragraph after an SVG shape.
</p>
Steps to Reproduce
Attempt to format an HTML file that contains small portions of XML tags.
Observe js-beautify doesn't format XML tags and the XML contents, because it really isn't supported to format XMLs.
Environment
OS: Windows 7 Enterprise LTS
Application: Visual Studio Code, which natively uses js-beautifier for formatting HTML files.
This seems reasonable, but it is far down on the list of priorities.
bitwiseman
changed the title
Do you think JS-Beautify should format XML tags inside HTML files?
JS-Beautify should format XML tags inside HTML files
May 3, 2018
When formatting HTML files that includes XML tags, such as
<svg>
, I've noticed it doesn't format the contents of<svg>
. Since<svg>
is part of XML, it is not supported for js-beautify.However, since the XML tag is inside an HTML file, should those also need supporting for HTML formatting?
I was told to file an issue here instead of VS Code, since they said any formatting issues should be redirected to the js-beautify project.
Input
The code looked like this before beautification:
Expected Output
The code should have looked like this after beautification:
Actual Output
The code actually looked like this after beautification:
Steps to Reproduce
Environment
OS: Windows 7 Enterprise LTS
Application: Visual Studio Code, which natively uses js-beautifier for formatting HTML files.
Settings
Example:
The text was updated successfully, but these errors were encountered: