We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
With jsoup 1.15.4 I get strange results when parsing a document again and again;
import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.nodes.Entities; import org.junit.jupiter.api.Test; import java.nio.charset.StandardCharsets; import static org.junit.jupiter.api.Assertions.assertEquals; public class JsoupTest { @Test public void test() { var text = """ <div> <a> <b>Hello</b> </a> </div>"""; var os = (new Document.OutputSettings()) .syntax(Document.OutputSettings.Syntax.html) .indentAmount(2) .charset(StandardCharsets.UTF_8) .escapeMode(Entities.EscapeMode.base) .prettyPrint(true) .outline(false); String text1 = Jsoup.parse(text).body().html(); String text2 = Jsoup.parse(text1).outputSettings(os).body().html(); String text3 = Jsoup.parse(text2).outputSettings(os).body().html(); String text4 = Jsoup.parse(text3).outputSettings(os).body().html(); System.out.println(text1 + "\n"); System.out.println(text2 + "\n"); System.out.println(text3 + "\n"); System.out.println(text4 + "\n"); assertEquals(text3, text4); } }
This test fails. And IMHO it shouldn't
The output is
<div><a> <b>Hello</b> </a> </div> <div> <a> <b>Hello</b> </a> </div> <div><a> <b>Hello</b> </a> </div> <div> <a> <b>Hello</b> </a> </div>
The text was updated successfully, but these errors were encountered:
Hi, thanks for the clear report. This is fixed already in the upcoming 1.16.1 release. I've made a few fixes but I think it would be #1906.
The output now is:
<div> <a> <b>Hello</b> </a> </div> <div> <a> <b>Hello</b> </a> </div> <div> <a> <b>Hello</b> </a> </div> <div> <a> <b>Hello</b> </a> </div>
Sorry, something went wrong.
It works! thank you so much!
No branches or pull requests
With jsoup 1.15.4 I get strange results when parsing a document again and again;
This test fails. And IMHO it shouldn't
The output is
The text was updated successfully, but these errors were encountered: