Page MenuHomePhabricator

(un)ordered lists shouldn't start/end container elements when newlines aren't present
Closed, DuplicatePublic

Description

The parser currently generates inconsistent HTML output from similar wikitext markup. I'll show two examples to make this clear:

If one has something like this:

:Introduction text
:# Item 1
:# Item 2
:# Item 3
:Signature

The whole thing, when rendered, should be enclosed in a <dl><dd></dd></dl>. What happens instead is that while the ordered list is placed inside the same <dd> of the intro text, the signature creates a new <dd>. All of it fits inside the <dl>, though.

Second case:

Introduction text
# Item 1
# Item 2
# Item 3
Signature

Here the generated HTML consists of 3 container (<p>) elements, with the intro text, the list, and the signature, respectively. This should instead be the case if one used:

Introduction text

# Item 1
# Item 2
# Item 3

Signature

But without the newlines, the whole thing should be inside a single <p>.

There isn't a validity or well-formedness problem here, but a semantic one: the author should be able to signal to the parser that the signature is part of the same semantic block as the list and the intro text; and in any case, the behavior should be consistent across mediawiki (the two examples above should behave the same) and follow the "newline-starts-new-block-element" behavior.


Version: unspecified
Severity: normal

Details

Reference
bz36212

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 12:22 AM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz36212.
bzimport added a subscriber: Unknown Object (MLST).