Honor implied end tags for dt and dd - #319
Conversation
Unclosed dt/dd left the parser stack mismatched, so closing a parent dl/body dropped the surrounding tree. Close them the way HTML does: another dt/dd starts, or the parent dl/body/html ends.
taoqf
left a comment
There was a problem hiding this comment.
https://developer.mozilla.org/en-US/docs/Glossary/Void_element
According to this, dt&dd are not void elements.
Thanks - agreed, Void elements ( https://html.spec.whatwg.org/multipage/syntax.html#optional-tags This repo already handles that for Happy to add a code comment on those entries making “optional end tag, not void” explicit if that helps. |
|
My mistake . Thank you. node-html-parser@9.0.4 released. |
Fixes #315
HTML lets
dt/ddomit their end tags. The parser didn't close them when the nextdt/ddstarted or whendl/body/htmlclosed, so the stack didn't match and the leftover-tag cleanup droppedbody/dl.Same implied-end-tag tables already used for
li/p/td.