Page MenuHomePhabricator

Parser output has a "list gap" for nested definition lists
Closed, DuplicatePublic

Description

Old PHP Parser output has a "list gap" (https://en.wikipedia.org/wiki/WP:LISTGAP) for nested definition lists like this (note the ;):

:A
::B
;C
:D

Actual HTML:

<dl><dd>A
<dl><dd>B</dd></dl></dd></dl>
<dl><dt>C</dt>
<dd>D</dd></dl>

Expected HTML:

<dl><dd>A
<dl><dd>B</dd></dl></dd>
<dt>C</dt>
<dd>D</dd></dl>

The same problem occurs for more practical examples, like below (I'll omit the actual and expected HTML because it's long):

;A
:B
;C
:D
:;E
::F
;G
:H

This affects real pages on Wikipedia (although probably very few), e.g. https://en.wikipedia.org/wiki/Focke-Wulf_Fw_190#Fw_190_A. You can probably find more examples by searching for insource:/:;/, but there's a lot of false positives.

This issue doesn't affect Parsoid: it outputs the expected HTML.

I noticed this while working on T279445.