From f0ae81b13eb3dee39d4b93e73913e5072bf5debd Mon Sep 17 00:00:00 2001 From: Jonathan Hedley Date: Tue, 25 Apr 2023 12:32:09 +1000 Subject: [PATCH] Check the buffer is fully read if looking for absent content Fixes #1929 In this case we are testing for a missing `` - but if the buffer hasn't been fully read, we could never find it. For the normal case that this code is looking for - a missing `` in brief HTML, a best-effort check (assuming the buffer is complete) is sufficient. --- CHANGES | 4 ++++ .../java/org/jsoup/parser/CharacterReader.java | 5 +++++ .../java/org/jsoup/parser/TokeniserState.java | 2 +- .../java/org/jsoup/parser/HtmlParserTest.java | 16 ++++++++++++++++ 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index b6770a211d..bca360ab1f 100644 --- a/CHANGES +++ b/CHANGES @@ -41,6 +41,10 @@ Release 1.16.1 [PENDING] * Bugfix:
tags should be wrap-indented when in block tags (and not when in inline tags). + * Bugfix: the contents of a sufficiently large "; + + Document doc = Jsoup.parse(sourceHtml); + Element textArea = doc.expectFirst("textarea"); + + assertEquals(textContent, textArea.wholeText()); + } }