syntax-tree/hast-util-raw

extra < being added by raw parser

Sewdn opened this issue · 2 comments

Sewdn commented

When a single word boundary character exists between tags, an extra < is added to the text value.

<p class='stage'>Ser på <b class='character'>kaptejnen</b>.</p>

yields:

<p class='stage'>Ser på <b class='character'>kaptejnen</b>.<</p>

As soon as there are multiple characters, or the character between the tags is no word boundary character, the extra < is not being added.

I assume this is because of the nature of the word boundary \b in regexes, not indicating a real character unless it is followed by another character. In this case the next character is the opening < f the closing tag.

Could you provide a more detailed example? What node and npm versions are you using, what os, what code are you running, etc?

Closing due to no response. Feel free to comment below if you have further comments.