mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-14 23:33:28 +00:00
htmlparser: Allow <p> as children of <dd> and <li>
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user