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
Unlike Python HTMLParser, Java version uses Jsoup.parseBodyFragment, which supports HTML parsing algorithm, so we don't have to worry about issues like #355.
But the serialization code should be aware of self-closing tags.
The text was updated successfully, but these errors were encountered:
This patch changes Java `HTMLProcessor` not to emit close tags if the tag is self-closing.
Also adds tests for:
* Unpaired close tags.
* Self-closing tags don't affect skip nodes (e.g., `<nobr>`.)
These test cases are from google#355.
Fixesgoogle#361.
kojiishi
changed the title
Java version emits close tag for self-closing tags
[java] Java version emits close tag for self-closing tags
Nov 11, 2023
kojiishi
changed the title
[java] Java version emits close tag for self-closing tags
[Java] Java version emits close tag for self-closing tags
Nov 12, 2023
* Java: Stop emitting close tags if self-closing
This patch changes Java `HTMLProcessor` not to emit close tags if the tag is self-closing.
Also adds tests for:
* Unpaired close tags.
* Self-closing tags don't affect skip nodes (e.g., `<nobr>`.)
These test cases are from #355.
Fixes#361.
Input:
<img>abcdef
Expected:
<img>abcdef
Actual:
<img></img>abcdef
Unlike Python
HTMLParser
, Java version usesJsoup.parseBodyFragment
, which supports HTML parsing algorithm, so we don't have to worry about issues like #355.But the serialization code should be aware of self-closing tags.
The text was updated successfully, but these errors were encountered: