Generating the tree structure fails for HTML that has a comment within a header or paragraph:
<h1>Hello World!<!-- How are you? --></h1>
The comment gets added to the header as a formatting element, as it should be, but something goes wrong when converting the comment from an Ignored node to a FormattingElement.
Generating the tree structure fails for HTML that has a comment within a header or paragraph:
The comment gets added to the header as a formatting element, as it should be, but something goes wrong when converting the comment from an
Ignored
node to aFormattingElement
.It currently errors on the calculation of the start- and end position of the formatting elements. Specifically on this line, where it fails to get the start tag. https://github.com/Yoast/YoastSEO.js/blob/545ce68d58bbc4df23e340653532fccab5381da5/src/tree/builder/cleanup/calculateTextIndices.js#L116
More importantly,
parse5
recognizesHow are you?
in the example below as a comment: