Page MenuHomePhabricator

If there are two warnings, then the second falls out of the "permissions-errors" block
Closed, InvalidPublic

Assigned To
None
Authored By
Iniquity
Apr 12 2021, 11:30 AM
Referenced Files
F34518069: image.png
Jun 21 2021, 12:31 PM
F34518055: image.png
Jun 21 2021, 12:31 PM
F34362405: image.png
Apr 12 2021, 2:22 PM
F34362413: image.png
Apr 12 2021, 2:22 PM
F34360068: image.png
Apr 12 2021, 11:30 AM
F34360073: proxy.png
Apr 12 2021, 11:30 AM

Description

Found weird dropout when on one page is used https://ru.wikipedia.org/wiki/MediaWiki:Protectedpagetext and https://ru.wikipedia.org/wiki/MediaWiki:Blockedtext. You can check this by editing this page with some proxy: https://ru.wikipedia.org/w/index.php?title=Template:Userbox&action=edit&uselang=ru.

This dropout from the list creates an unexpected marker and breaks the structure.

proxy.png (891×1 px, 109 KB)
image.png (93×370 px, 5 KB)

Current

Breacked DOM. The second warning is outside the parent element. A marker is displayed.

Expected

All warnings are in one <ul> block. The marker is not displayed unnecessarily or can be easily removed.

Event Timeline

matmarex subscribed.

This looks like a bug in the wikitext parser, occuring when you mix the HTML lists, wikitext lists, and HTML tables.

Here's the simplest test case I found that causes the same problem – try pasting this into https://ru.wikipedia.org/wiki/Служебная:Развёртка_шаблонов (Special:ExpandTemplates):

WikitextHTML outputScreenshot
1<ul>
2<li><table><tr><td>
3test
4* a
5* b
6* c</td></tr></table></li>
7<li>test</li>
8</ul>
1<div class="mw-parser-output"><ul>
2<li><table><tbody><tr><td>
3<p>test
4</p>
5<ul><li>a</li>
6<li>b</li>
7<li>c</li></ul></td></tr></tbody></table></li></ul>
8<li>test</li>
9</div>
image.png (301×570 px, 7 KB)

Luckily, there is a simple workaround – just add a line break at the end of the last wikitext list item:

WikitextHTML outputScreenshot
1<ul>
2<li><table><tr><td>
3test
4* a
5* b
6* c
7</td></tr></table></li>
8<li>test</li>
9</ul>
1<div class="mw-parser-output"><ul>
2<li><table><tbody><tr><td>
3<p>test
4</p>
5<ul><li>a</li>
6<li>b</li>
7<li>c</li></ul>
8</td></tr></tbody></table></li>
9<li>test</li>
10</ul></div>
image.png (301×570 px, 7 KB)

You can probably achieve that on https://ru.wikipedia.org/wiki/MediaWiki:Protectedpagetext and https://ru.wikipedia.org/wiki/MediaWiki:Blockedtext by adding <nowiki/> on a separate line after the template parameters, to ensure that the line break is not removed.

Parsoid doesn't have this bug, so one less thing to worry about there.

You can probably achieve that on https://ru.wikipedia.org/wiki/MediaWiki:Protectedpagetext and https://ru.wikipedia.org/wiki/MediaWiki:Blockedtext by adding <nowiki/> on a separate line after the template parameters, to ensure that the line break is not removed.

Ok, we will do it, thanks :)

You can probably achieve that on https://ru.wikipedia.org/wiki/MediaWiki:Protectedpagetext and https://ru.wikipedia.org/wiki/MediaWiki:Blockedtext by adding <nowiki/> on a separate line after the template parameters, to ensure that the line break is not removed.

Does not work :(

I'm sorry, I forgot about this task, and only ran into it today while cleaning up my notifications.

I was able to fix the problem on-wiki with this edit: https://ru.wikipedia.org/w/index.php?title=MediaWiki:Protectedpagetext&diff=115033821&oldid=113622335&diffmode=source (I'm a global interface editor). Sorry for not explaining it clearly enough!

Before:
image.png (2×3 px, 675 KB)
After:
image.png (2×3 px, 682 KB)

I think task T11996 describes the same parser bug, so I'll close this one.