Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public class KsoupHtmlParser(
this.endOpenTag(isOpenImplied)

// Self-closing tags will be on the top of the stack
if (this.stack[this.stack.size - 1] == name) {
if (this.stack.getOrNull(this.stack.size - 1) == name) {
// If the opening tag isn't implied, the closing tag has to be implied.
this.handler.onCloseTag(name, !isOpenImplied)
this.stack.removeLast()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,4 +270,17 @@ class KsoupHtmlParserTest {
expectedString = "First lineSecond line",
)
}

@Test
fun testBigHtml() {
val handler = KsoupHtmlHandler
.Builder()
.build()

val ksoupHtmlParser = KsoupHtmlParser(
handler = handler,
)
ksoupHtmlParser.write(TestData.htmlString)
ksoupHtmlParser.end()
}
}
Loading