diff options
author | rumpf_a@web.de <> | 2010-02-14 09:59:01 +0100 |
---|---|---|
committer | rumpf_a@web.de <> | 2010-02-14 09:59:01 +0100 |
commit | 01fb99bc804ecc38bc2b7e36aefeba338d5604e4 (patch) | |
tree | 0d5b29c935017263e1fae78a3c87cc784ed25ac5 /lib/pure | |
parent | 597d98e7ee9cf60ec1ed601a311975384d65cba8 (diff) | |
download | Nim-01fb99bc804ecc38bc2b7e36aefeba338d5604e4.tar.gz |
further improvements for the HTML parser
Diffstat (limited to 'lib/pure')
-rw-r--r-- | lib/pure/htmlparser.nim | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/pure/htmlparser.nim b/lib/pure/htmlparser.nim index 4e4af0e4b..81a3a8cb4 100644 --- a/lib/pure/htmlparser.nim +++ b/lib/pure/htmlparser.nim @@ -152,7 +152,7 @@ const tagOl, tagP, tagPre, tagTable, tagUl, tagCenter, tagDir, tagIsindex, tagMenu, tagNoframes} SingleTags* = {tagArea, tagBase, tagBasefont, - tagBr, tagCol, tagFrame, tagHr, tagImg, tagInput, tagIsindex, + tagBr, tagCol, tagFrame, tagHr, tagImg, tagIsindex, tagLink, tagMeta, tagParam} Entities = [ @@ -276,7 +276,7 @@ proc untilElementEnd(x: var TXmlParser, result: PXmlNode, case x.kind of xmlElementStart, xmlElementOpen: case result.htmlTag - of tagLi, tagP, tagDt, tagDd, tagOption: + of tagLi, tagP, tagDt, tagDd, tagInput, tagOption: if htmlTag(x.elementName) notin InlineTags: # some tags are common to have no ``</end>``, like ``<li>``: errors.add(expected(x, result)) @@ -285,6 +285,10 @@ proc untilElementEnd(x: var TXmlParser, result: PXmlNode, if htmlTag(x.elementName) in {tagTr, tagTd, tagTh}: errors.add(expected(x, result)) break + of tagOptgroup: + if htmlTag(x.elementName) in {tagOption, tagOptgroup}: + errors.add(expected(x, result)) + break else: nil result.addNode(parse(x, errors)) of xmlElementEnd: |