Page MenuHomePhabricator

Tidy: Numbered list markup with <pre> inbetween creates empty first bullet after <pre> section
Closed, ResolvedPublic

Description

Author: thelittlegreenrosetta

When using wiki-markup to create a numbered list, I'm getting unexpected results when trying to start the list at a specific number.

This link shows describes the problem with code.

https://wikitech.wikimedia.org/wiki/User:Little_green_rosetta/bug

Details

Reference
bz48079

Event Timeline

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

Thanks for reporting.

Interesting, I cannot reproduce on test2.wikipedia.org (behaving as expected).

The bug occurs on a fresh MediaWiki installation. I suppose one of the extensions on the WMF cluster is making the bug go away.

(In reply to This, that and the other from comment #2)

The bug occurs on a fresh MediaWiki installation. I suppose one of the
extensions on the WMF cluster is making the bug go away.

That would be Tidy?

Ah, of course, it probably is Tidy! I didn't think of that, as it's not a MediaWiki extension.

We just need someone to confirm whether or not Tidy is enabled on wikitech...

(In reply to This, that and the other from comment #4)

We just need someone to confirm whether or not Tidy is enabled on wikitech...

It's disabled on twn too, and the thing is reproducible there https://translatewiki.net/w/i.php?title=Sandbox&oldid=5390999
That said, the proposed usecase is very weird wikitext, is it really legal? It's similar to bug 9737 or bug 9996 where the latter is almost a dupe of bug 1581...

Izno added a subscriber: Izno.

So, this is technically reproducible under Remex, which will output the following HTML:

<ol><li>A</li>
<li>B</li>
<li>C</li></ol>
<pre>testing
</pre>
<ol><li class="mw-empty-elt"></li><li value="7"> D</li>
<li>E</li>
<li>F</li></ol>

Most skins will target that empty list element with a CSS display:none directive and so it won't display. (Timeless is a skin which currently does not, but that's T181186 anyway.)

There should probably be better support in wikitext for this use case, which is seen in the wild. There might be a task lying around for that.

This bug should be resolved and a separate feature request task opened for first class wikitext support for this. The Tidy/Remex part of it has been dealt with. The empty-element business in Timeless is its own bug anyway.

ssastry claimed this task.