syntax-tree / hast-util-raw

utility to reparse a hast tree
https://unifiedjs.com
MIT License
11 stars 4 forks source link

extra < being added by raw parser #5

Closed Sewdn closed 6 years ago

Sewdn commented 6 years ago

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.

wooorm commented 6 years ago

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

wooorm commented 6 years ago

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