You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The table tag inside span of p tag is unwrapped as next sibling of p tag. Additionally an empty p tag is created as the next sibling of the unwrapped table tag. This output is not seen in Chrome and Firefox browsers
The text was updated successfully, but these errors were encountered:
In HtmlTreeBuilderState, we are treating the document as No Quirks, but because there is no doctype, it should be treated as Quirks, and so the p should not be closed when the table gets opened.
jsoup's doesn't currently implement Quirks Mode completely. We do go into quirks mode when parsing invalid doctypes, but don't have the expected doctype tests. Implementing that would allow this to be fixed.
Checked in Chrome and if there is a valid doctype and so in No-Quirks mode, Chrome does parse the same as jsoup does currently:
jhy
changed the title
Jsoup Issue: <table> tag inside <span> of <p> tags are getting unwrapped outside and empty <p> tags are created
Should parse in Quirks Mode if doctype not set
Sep 10, 2024
Input:
Jsoup output:
Ref link: https://try.jsoup.org/~PNrKdofSo_QE8KX2IbZKZ-xxyq0
The table tag inside span of p tag is unwrapped as next sibling of p tag. Additionally an empty p tag is created as the next sibling of the unwrapped table tag. This output is not seen in Chrome and Firefox browsers
The text was updated successfully, but these errors were encountered: