Closed IMSoP closed 4 years ago
if that is the browsers behavior, I think that we should do the same.
Are you willing to submit a patch for this?
I'll give it a go; by the looks of it, it will just need a special case at the top of DOMTreeBuilder::endTag
The WHATWG spec includes a special rule for handling
</br>
, in the section on parsing when "in body":The result is that invalid HTML like
Hello <br>World</br>!
will be rendered by browsers as though it had two linebreaks,Hello <br>World<br>!
. This library currently (quite reasonably!) removes the erroneous end tag instead, givingHello <br>World!
I'm using this library for processing some messy HTML, and it would be useful to have this rule match the spec / browser behaviour.