In addition, this also messes up the DOM Tree stack, which is the actual problem here.
Possible solution
All NonVoidHtmlElementStartTagWithTrailingSolidus should be considered a hard error.
Nice-to-have
It would also be nice to do RegEx search-replace as a utility in fervid.
Another option is to parse the HTML and only apply this fix to where the NonVoidHtmlElementStartTagWithTrailingSolidus problem is encountered.
Problem
The official Vue parser allows self-closing any HTML, but this is not valid by the spec. For example, this:
Using Nu HTML Checker by W3 results in a clear error:
The same happens when parsing with
swc_html_parser
. The error is being reported and the tag is not being closed:In addition, this also messes up the DOM Tree stack, which is the actual problem here.
Possible solution
All
NonVoidHtmlElementStartTagWithTrailingSolidus
should be considered a hard error.Nice-to-have
It would also be nice to do RegEx search-replace as a utility in
fervid
. Another option is to parse the HTML and only apply this fix to where theNonVoidHtmlElementStartTagWithTrailingSolidus
problem is encountered.