In certain situations with template interpolation, quotes inside an HTML attribute could be valid HTML. The current HTML parser throws an exception when an interpolation attribute contains a quote.
Prettier pr-5800
Playground link
Input:
<div data-for={value['foo']} data-for={value["foo"]}></div>
Output:
SyntaxError: Unexpected closing tag "div". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags (1:54)
> 1 | <div data-for={value['foo']} data-for={value["foo"]}></div>
| ^
Expected behavior:
The HTML parser should parse these values correctly so they can be used in the interpolation value.
In certain situations with template interpolation, quotes inside an HTML attribute could be valid HTML. The current HTML parser throws an exception when an interpolation attribute contains a quote.
Prettier pr-5800
Playground link
Input:
Output:
Expected behavior:
The HTML parser should parse these values correctly so they can be used in the interpolation value.