File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
jvm/src/test/scala/scala/xml/parsing
shared/src/main/scala/scala/xml/parsing Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -91,4 +91,10 @@ class ConstructingParserTest {
9191 val parser : ConstructingParser = ConstructingParser .fromSource(Source .fromString(xml), preserveWS = true )
9292 parser.document().docElem // shouldn't crash
9393 }
94+
95+ @ Test (expected = classOf [scala.xml.parsing.FatalError ])
96+ def issue656 (): Unit = {
97+ // mismatched quotes should not cause an infinite loop
98+ XhtmlParser (Source .fromString(""" <html><body myAttribute='value"/></html>""" ))
99+ }
94100}
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ private[scala] trait MarkupParserCommon extends TokenTests {
6767 val buf : StringBuilder = new StringBuilder
6868 while (ch != endCh && ! eof) {
6969 // well-formedness constraint
70- if (ch == '<' ) reportSyntaxError (" '<' not allowed in attrib value" )
70+ if (ch == '<' ) truncatedError (" '<' not allowed in attrib value" )
7171 else if (ch == SU ) truncatedError(" " )
7272 else buf.append(ch_returning_nextch)
7373 }
You can’t perform that action at this time.
0 commit comments