Skip to content

Commit

Permalink
Test BRs are treated as newlines in wholeText
Browse files Browse the repository at this point in the history
For #1437

Was fixed by #1636
  • Loading branch information
jhy committed Jan 2, 2022
1 parent f24175e commit 22f05e8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/test/java/org/jsoup/nodes/ElementTest.java
Expand Up @@ -2205,4 +2205,15 @@ void prettySerializationRoundTrips(Document.OutputSettings settings) {
String html2 = doc2.html();
assertEquals(html, html2);
}

@Test void elementBrText() {
// testcase for https://github.com/jhy/jsoup/issues/1437
String html = "<p>Hello<br>World</p>";
Document doc = Jsoup.parse(html);
Element p = doc.select("p").first();
assertNotNull(p);
assertEquals(html, p.outerHtml());
assertEquals("Hello World", p.text());
assertEquals("Hello\nWorld", p.wholeText());
}
}

0 comments on commit 22f05e8

Please sign in to comment.