Page MenuHomePhabricator

Unordered list after <center>ed heading contains additional <li>s
Closed, ResolvedPublic

Description

Whenever you have centered heading (==<center>Heading</center>==), then it somehow changes following tags in HTML so that they contain <span class="mw-headline" id="Heading">(usual text)</span> that they shouldn't. In case of unordered list (ordered list works the same as other tags) this causes insetion of <li style="list-style-type: none; list-style-image: none; list-style-position: outside;"><span class="mw-headline" id="Heading"></span></li> after every item. This probably shouldn't be visible, but Internet Expolorer seems to ignore that style and so shows an empty list item after every normal item.

Example:

==<center>Heading</center>==

* foo

is rendered as:

<h2><span class="mw-headline" id="Heading"></span></h2>
<center>
<h2>Heading</h2>
</center>
<ul>
<li><span class="mw-headline" id="Heading">foo</span></li>
<li style="list-style-type: none; list-style-image: none; list-style-position: outside;"><span class="mw-headline" id="Heading"></span></li>
</ul>

Version: 1.16.x
URL: http://en.wikipedia.org/wiki/Wikipedia:Village_pump_%28technical%29#Table_weirdness

Details

Reference
bz20829

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:50 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz20829.
bzimport added a subscriber: Unknown Object (MLST).

Probably worth noting that the page in question is:
http://en.wikipedia.org/w/index.php?title=Wikipedia:Template_messages&oldid=316046939

And that the heading markup is used in a table.

rockmfr wrote:

So far I've been unable to reproduce this in a local installation. Seems like a Tidy-related bug (which I can't get working locally).

rockmfr wrote:

Okay, I was finally able to reproduce locally. Results with Tidy enabled:

<center>foo</center>

*bar

r52962:
<p><a name="foo" id="foo"></a></p>
<center>
<h2>foo</h2>
</center>
<ul>
<li><span class="mw-headline">bar</span></li>
</ul>

r52963-r53576:
<h2 id="foo"></h2>
<center>
<h2 id="foo">foo</h2>
</center>
<ul>
<li><span class="mw-headline">bar</span></li>
</ul>

r53577:
<h2><span class="mw-headline" id="foo"></span></h2>
<center>
<h2>foo</h2>
</center>
<ul>
<li><span class="mw-headline" id="foo">bar</span></li>
<li style="list-style: none"><span class="mw-headline" id="foo"></span></li>
</ul>

This looks like a Tidy quirk/bug to me.

Izno claimed this task.
Izno subscribed.

The Remex output is

<h2>
<span class="mw-headline" id="Heading"><center>Heading</center></span>
<span class="mw-editsection"><span class="mw-editsection-bracket">[</span>
  <a href="/w/index.php?title=User:Izno&amp;action=edit&amp;section=4" title="Edit section: Heading">edit</a>
  <span class="mw-editsection-bracket">]</span>
</span>
</h2>
<ul>
<li>foo</li>
</ul>

This is not reproducible with RemexHtml. So, closing as resolved.

:D I've been Tidying the Tidy project tasks.

:D I've been Tidying the Tidy project tasks.

Thanks! :)