-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Labels
fixedAn {bug|improvement} that has been {fixed|implemented}An {bug|improvement} that has been {fixed|implemented}
Milestone
Description
Probably related to #2258.
Parsing the following HTML even with master (checked out 5d31cac at the moment), doesn't work:
<button>
<template>
<button></button>
</template>
</button>I think that HTML should be valid according to spec. MDN says that template is allowed inside every element that accepts phrasing content and buttons accept phrasing content.
I also put that snippet through https://validator.w3.org which passed:
Still it doesn't get parsed correctly. I added a test to HtmlParserTest. The test currently passes that way, which is incorrect:
@Test void templateInButton() {
String html = "<button> <template><button></button></template> </button>";
Document doc = Jsoup.parse(html);
assertEquals("<button><template></template></button><button></button>",
TextUtil.stripNewlines(doc.body().html()));
}We can see that the inner button ends up being interpreted as a sibling of the outer button.
Metadata
Metadata
Assignees
Labels
fixedAn {bug|improvement} that has been {fixed|implemented}An {bug|improvement} that has been {fixed|implemented}
