htmlparser: Allow <p> as children of <dd> and <li>
This commit is contained in:
parent
be22071b2e
commit
5bac8cd855
1 changed files with 8 additions and 2 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue