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
{{ message }}
Repository navigation
Inconsistent handling of U+0000 NULLs in input stream #2395
A solitary U+0000 NULL within a <p> tag is removed when parsing. However, that only happens if there is no other text; with other text, the U+0000 is preserved.
Removing the tags is (I believe) correct, section 13.2.6.4.7 The "in body" insertion mode of the spec says that U+0000 NULL should be ignored.
TokeniserState.Date has a switch statement with a case for U+0000 which adds an error, but the text is appended to the token, and HtmlTreeBuilderState.InBody (line 289), checks whether the token equals a singleton U+0000.
Activity
jhy commentedon Sep 8, 2025
Thanks for raising that!
Fixed by dedf6ab
[Jsoup] null characters (\0) in HTML are replaced/removed during toke…
[Jsoup] null characters (\0) in HTML are replaced/removed during toke…
[Jsoup] null characters (\0) in HTML are replaced/removed during toke…
[Jsoup] null characters (\0) in HTML are replaced/removed during toke…