This commit is contained in:
Araq 2013-06-27 07:43:04 +02:00
commit 82ceca0717
2 changed files with 3 additions and 3 deletions

View file

@ -544,6 +544,8 @@ proc parseHtml*(s: PStream, filename: string,
# force progress! # force progress!
next(x) next(x)
close(x) close(x)
if result.len == 1:
result = result[0]
proc parseHtml*(s: PStream): PXmlNode = proc parseHtml*(s: PStream): PXmlNode =
## parses the XTML from stream `s` and returns a ``PXmlNode``. All parsing ## parses the XTML from stream `s` and returns a ``PXmlNode``. All parsing

View file

@ -110,11 +110,9 @@ proc parseXml*(s: PStream, filename: string,
of xmlElementOpen, xmlElementStart: of xmlElementOpen, xmlElementStart:
result = parse(x, errors) result = parse(x, errors)
break break
of xmlComment, xmlWhitespace: nil # just skip it of xmlComment, xmlWhitespace, xmlSpecial: nil # just skip it
of xmlError: of xmlError:
errors.add(errorMsg(x)) errors.add(errorMsg(x))
of xmlSpecial:
errors.add(errorMsg(x, "<some_tag> expected"))
else: else:
errors.add(errorMsg(x, "<some_tag> expected")) errors.add(errorMsg(x, "<some_tag> expected"))
break break