Page MenuHomePhabricator

Initial hashes/asterisks fail to be recognised if the previous line contains them, but forces that list to end due to a </div>.
Open, LowPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

This also happens if there's a bare </ul> or </ol> tag with no previous opening <ul> or <ol> rather than explicitly a </div>, but that situation isn't likely to be encountered.

What happens?:
The asterisks/hashes on the line after the div block will fail to create their respective <ul> and <ol> tags if these asterisks/hashes are present on the previous line, presumably under the assumption that they should inherit the one from the previous line. The same will also apply to the next lines afterwards.
This may also result in a bare <li> item being created with no list to contain it.

Image showing the input and corresponding parser output, aligned with each other:

list_problem.png (629×366 px, 7 KB)

What should have happened instead?:
The asterisks/hashes on the new line should create their own <ul> and <ol>, as it is impossible to re-use the one on the previous line.

Event Timeline

Aklapper added a project: MediaWiki-Parser.

An unclosed DIV "within" a list item is to me malformed-syntax.

opening/closing DIV tags for a list should be on a single line. (This might be a linting issue?)

An unclosed DIV "within" a list item is to me malformed-syntax.

opening/closing DIV tags for a list should be on a single line. (This might be a linting issue?)

The issue is spawned by the inverse: a div that contains a list rather than a list that contains a div. If you start a div tag inside of a list, a linebreak will forcefully terminate the div as presumably intended. In fact, trying to use a </div> within a list item without an opening <div> will not result into this as there's no reason to terminate the list.
The list after the div block is treated as contiguous with the one inside of the div block when it shouldn't be. I've run into it when trying to use a list directly after an infobox.