Page MenuHomePhabricator

In minerva <li>s that contain <dl>s don't nest unless newlines are included in the wikitext
Open, Needs TriagePublic

Description

When a list contains wikitext indentation, the rendered output is not consistent in minerva, impacting the indent levels.

Example in Vector : https://test.wikipedia.org/w/index.php?title=User:Xaosflux/sandbox&oldid=464254&safemoce=1&useskin=vector

Example in Minerva : https://test.wikipedia.org/w/index.php?title=User:Xaosflux/sandbox&oldid=464254&safemoce=1&useskin=minerva

Notice in Minerva, section 2 indentations are off, though it is not expected that </li><li> code should require a newline

Originally reported on enwiki by Intforce in https://en.wikipedia.org/wiki/Template_talk:Ordered_list#Display_error_on_mobile

Event Timeline

ssastry subscribed.

If the rendering changes / breaks when the skin is switched, it is very likely a CSS difference. In any case, it is nothing related to Parsoid since you are looking at output of the core parser.

Aklapper renamed this task from in minerva <li>'s that contain <dl>'s dont nest unless newlnes are included in the wikitext to In minerva <li>s that contain <dl>s don't nest unless newlines are included in the wikitext.Jan 21 2021, 8:45 AM
Jdlrobson subscribed.

Minerva doesn't touch HTML so any margins are likely controlled by CSS and visual differences with different skins is to be expected

How does this impact end users?

@Jdlrobson see below, the indentations after the first item are wrong

image.png (313×218 px, 3 KB)

We're expecting the output under II to be:

image.png (100×171 px, 1 KB)

But instead it is generating as:

image.png (80×153 px, 1 KB)

Notice the lack of a <dl> generation

And this only appears to be off in minerva

Okay you shared the link to desktop Minerva, not mobile, and I can only see the invalid HTML only when adding the mobile domain e.g.:
https://test.m.wikipedia.org/w/index.php?title=User:Xaosflux/sandbox&oldid=464254&safemode=1&useskin=minerva

The MobileFormatter in MobileFrontend can trip up when given invalid HTML. That results in the visual difference.

The parser is generating invalid HTML
https://validator.w3.org/nu/?doc=https%3A%2F%2Ftest.wikipedia.org%2Fw%2Findex.php%3Ftitle%3DUser%3AXaosflux%2Fsandbox%26oldid%3D464254%26safemode%3D1%26useskin%3Dfallback

@ssastry this is either a bug with the parser or a case of garbage in garbage out. I'll let you decide:

Specifically

<div><ol style="list-style-type:upper-roman"><li>''Aaaaa''
:AAA.</li><li>''Baaaa''
:BBB</li><li>''Caaaa''
:CCC</li><li>''Daaaa''
:DDD</li></ol></div>

Is outputting as

<ol style="list-style-type:upper-roman">
    <li>
        <i>Aaaaa</i>
        <dl><dd>AAA.</dd></dl>
    </li>
    <li>
        <i>Baaaa</i>
        <dd>BBB</dd> <!-- invalid HTML here-->
    </li>
    <li>
        <i>Caaaa</i>
        <dd>CCC</dd> <!-- invalid HTML here-->
    </li>
    <li>
        <i>Daaaa</i>
        <dd>DDD</dd></li> <!-- invalid HTML here-->
</ol>