summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-11-05 15:27:37 +0100
committerAndreas Rumpf <rumpf_a@web.de>2016-11-05 15:27:47 +0100
commit5471b1eacad50a313133c93f68b3495948479bb3 (patch)
treeaf351fdf92160d9cf6f7d12c40d5648ad9241995
parent708b481c42da20449fa14901d5487c9606bd619a (diff)
downloadNim-5471b1eacad50a313133c93f68b3495948479bb3.tar.gz
htmlparser: support parsing of class=foobar without quotes
-rw-r--r--lib/pure/parsexml.nim4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/pure/parsexml.nim b/lib/pure/parsexml.nim
index aa4a13ecf..978c9c516 100644
--- a/lib/pure/parsexml.nim
+++ b/lib/pure/parsexml.nim
@@ -572,6 +572,10 @@ proc parseAttribute(my: var XmlParser) =
           inc(pos)
   else:
     markError(my, errQuoteExpected)
+    # error corrections: guess what was meant
+    while buf[pos] != '>' and buf[pos] > ' ':
+      add(my.b, buf[pos])
+      inc pos
   my.bufpos = pos
   parseWhitespace(my, skip=true)