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
In HTML, <col> is a singleton tag: it can't contain any content, and if it doesn't have the closing '/' it's still a complete tag on its own. Because of this, js-beautify's HTML beautifier doesn't indent the line after any tag that shares a name with one of these singleton tags. Even if the "self-closing" tag is closedlater
However, this is not a feature of JSX, even when representing native DOM tags; JSX follows the rules of strict XML in this regard. The solution is probably to use a beautifier library built for XML rather than HTML to deal with the JSX bits.
This tends to pop up a lot in practice, since many HTML singleton tag names are pretty common to use as React component names e.g. col, input, link, command, etc.
The text was updated successfully, but these errors were encountered:
Example output:
In HTML,
<col>
is a singleton tag: it can't contain any content, and if it doesn't have the closing '/' it's still a complete tag on its own. Because of this, js-beautify's HTML beautifier doesn't indent the line after any tag that shares a name with one of these singleton tags. Even if the "self-closing" tag is closedlaterHowever, this is not a feature of JSX, even when representing native DOM tags; JSX follows the rules of strict XML in this regard. The solution is probably to use a beautifier library built for XML rather than HTML to deal with the JSX bits.
This tends to pop up a lot in practice, since many HTML singleton tag names are pretty common to use as React component names e.g. col, input, link, command, etc.
The text was updated successfully, but these errors were encountered: