Skip to content

Commit

Permalink
add test for jhy#1294
Browse files Browse the repository at this point in the history
  • Loading branch information
wudiiv11 committed May 8, 2020
1 parent f6e12f5 commit a73202f
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/test/java/org/jsoup/integration/ParseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,28 @@ public void testXwikiExpanded() throws IOException {
assertEquals(wantHtml, doc.select("[data-id=userdirectory]").outerHtml());
}

@Test public void testParseRubyTag() {
String html = "<ruby>a<div><rtc><rt>b</rt></rtc></div></ruby>";
Document doc = Jsoup.parse(html);
assertEquals("<html>\n" +
" <head></head>\n" +
" <body>\n" +
" <ruby>a\n" +
" <div>\n" +
" <rtc>\n" +
" <rt>b</rt>\n" +
" </rtc>\n" +
" </div></ruby>\n" +
" </body>\n" +
"</html>",doc.toString().trim());
}

@Test public void testDivInsideRuby() {
String html = "<ruby><rtc><div><rt>a</rt><rtc></ruby>";
Document doc = Jsoup.parse(html);
assertTrue(doc.toString().contains("</rt>"));
}

public static File getFile(String resourceName) {
try {
URL resource = ParseTest.class.getResource(resourceName);
Expand Down

0 comments on commit a73202f

Please sign in to comment.