From 82ceca071710d693e1611505c9dfff7aee375045 Mon Sep 17 00:00:00 2001 From: Araq Date: Thu, 27 Jun 2013 07:43:04 +0200 Subject: [PATCH] fixes #492 --- lib/pure/htmlparser.nim | 2 ++ lib/pure/xmlparser.nim | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/pure/htmlparser.nim b/lib/pure/htmlparser.nim index c941708031..e1a0096f6e 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 8c5c5f5ab5..355053e0dc 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, " expected")) else: errors.add(errorMsg(x, " expected")) break