taoqf / node-html-parser

A very fast HTML parser, generating a simplified DOM, with basic element query support.
MIT License
1.11k stars 107 forks source link

Header tags should be considered block elements #131

Closed onhate closed 3 years ago

onhate commented 3 years ago

I would expect the outcome of the following html snippet when invoking structuredText to be content inside html but instead I'm getting content insidehtml

<p>content</p><span><u><h1>inside</h1><i>htm<u>l</u></i></u></span>

According to what is rendered as html it was supposed to have an extra space on the header element, correct?

https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements

<h1>, <h2>, <h3>, <h4>, <h5>, <h6>
Heading levels 1-6.
2021-06-23 at 10 23 01@2x
HTMLParser.parse("<p>content</p><span><u><h1>inside</h1><i>htm<u>l</u></i></u></span>").structuredText;