snoyberg / xml

Various XML utility packages for Haskell
71 stars 64 forks source link

Parser improperly handles optional tags under html5 rules #169

Open tysonzero opened 3 years ago

tysonzero commented 3 years ago

https://html.spec.whatwg.org/multipage/syntax.html#optional-tags

Minimal incorrect example:

renderMarkup . toMarkup $ parseLT "<td>foo<td>bar"

It currently gives:

"<!DOCTYPE HTML>\n<td>foo<td>bar</td></td>"

But it should give one of:

"<!DOCTYPE HTML>\n<td>foo</td><td>bar</td>"
"<!DOCTYPE HTML>\n<td>foo<td>bar"

If html4 / xhtml5 parsing is also desired then separate functions/modules may be needed.