summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--lib/pure/htmlparser.nim2
-rw-r--r--lib/pure/xmlparser.nim4
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/pure/htmlparser.nim b/lib/pure/htmlparser.nim
index c94170803..e1a0096f6 100644
--- a/lib/pure/htmlparser.nim
+++ b/lib/pure/htmlparser.nim
@@ -544,6 +544,8 @@ proc parseHtml*(s: PStream, filename: string,
       # force progress!
       next(x)
   close(x)
+  if result.len == 1:
+    result = result[0]
 
 proc parseHtml*(s: PStream): PXmlNode = 
   ## parses the XTML from stream `s` and returns a ``PXmlNode``. All parsing
diff --git a/lib/pure/xmlparser.nim b/lib/pure/xmlparser.nim
index 8c5c5f5ab..355053e0d 100644
--- a/lib/pure/xmlparser.nim
+++ b/lib/pure/xmlparser.nim
@@ -110,11 +110,9 @@ proc parseXml*(s: PStream, filename: string,
     of xmlElementOpen, xmlElementStart: 
       result = parse(x, errors)
       break
-    of xmlComment, xmlWhitespace: nil # just skip it
+    of xmlComment, xmlWhitespace, xmlSpecial: nil # just skip it
     of xmlError:
       errors.add(errorMsg(x))
-    of xmlSpecial:
-      errors.add(errorMsg(x, "<some_tag> expected"))      
     else:
       errors.add(errorMsg(x, "<some_tag> expected"))
       break