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 @@ -91,4 +91,10 @@ class ConstructingParserTest {
val parser: ConstructingParser = ConstructingParser.fromSource(Source.fromString(xml), preserveWS = true)
parser.document().docElem // shouldn't crash
}

@Test(expected = classOf[scala.xml.parsing.FatalError])
def issue656(): Unit = {
// mismatched quotes should not cause an infinite loop
XhtmlParser(Source.fromString("""<html><body myAttribute='value"/></html>"""))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private[scala] trait MarkupParserCommon extends TokenTests {
val buf: StringBuilder = new StringBuilder
while (ch != endCh && !eof) {
// well-formedness constraint
if (ch == '<') reportSyntaxError("'<' not allowed in attrib value")
if (ch == '<') truncatedError("'<' not allowed in attrib value")
else if (ch == SU) truncatedError("")
else buf.append(ch_returning_nextch)
}
Expand Down