diff options
author | Stephane Fontaine <stefont@gmail.com> | 2016-07-27 15:14:34 +0400 |
---|---|---|
committer | Stephane Fontaine <stefont@gmail.com> | 2016-07-27 15:29:26 +0400 |
commit | 5bac8cd8558048292bdc071fe09aa80191677719 (patch) | |
tree | 2231d67505d9ff931c21edc0d06854202bf75f44 /lib/pure | |
parent | be22071b2e4c4233f074132b48f1687051fb2fd9 (diff) | |
download | Nim-5bac8cd8558048292bdc071fe09aa80191677719.tar.gz |
htmlparser: Allow <p> as children of <dd> and <li>
Diffstat (limited to 'lib/pure')
-rw-r--r-- | lib/pure/htmlparser.nim | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/pure/htmlparser.nim b/lib/pure/htmlparser.nim index fd58bed25..1fe0b297b 100644 --- a/lib/pure/htmlparser.nim +++ b/lib/pure/htmlparser.nim @@ -464,12 +464,18 @@ proc untilElementEnd(x: var XmlParser, result: XmlNode, case x.kind of xmlElementStart, xmlElementOpen: case result.htmlTag - of tagLi, tagP, tagDt, tagDd, tagInput, tagOption: - # some tags are common to have no ``</end>``, like ``<li>``: + of tagP, tagInput, tagOption: + # some tags are common to have no ``</end>``, like ``<li>`` but + # allow ``<p>`` in `<dd>`, `<dt>` and ``<li>`` in next case if htmlTag(x.elemName) in {tagLi, tagP, tagDt, tagDd, tagInput, tagOption}: errors.add(expected(x, result)) break + of tagDd, tagDt, tagLi: + if htmlTag(x.elemName) in {tagLi, tagDt, tagDd, tagInput, + tagOption}: + errors.add(expected(x, result)) + break of tagTd, tagTh: if htmlTag(x.elemName) in {tagTr, tagTd, tagTh, tagTfoot, tagThead}: errors.add(expected(x, result)) |