555 B
555 B
Fix inconsistent language comment detection (#9743 by @fisker)
An /* HTML */ comment should directly precede a template literal for the latter to be recognized as HTML-in-JS. Previously, the comment was erroneously recognized is some other locations.
// Input
foo /* HTML */ = `<DIV>
</DIV>`;
// Prettier stable (--parser=babel)
foo /* HTML */ = `<div></div>`;
// Prettier stable (--parser=meriyah)
foo /* HTML */ = `<DIV>
</DIV>`;
// Prettier main (All JavaScript parsers)
foo /* HTML */ = `<DIV>
</DIV>`;