Page MenuHomePhabricator

wrapWikiMsg can produce invalid html
Closed, ResolvedPublic

Description

The most use of wrapWikiMsg is "<div class='mw-history-legend'>\n$1</div>", but it is better to also add a newline behind $1.

The problem is, when the wrap message use a list at the end, the closing div is added to the last item of this list. But the parser closed the list behind the div, so the ol and div are in the wrong order.

On normal wikipages, HTML Tidy is correted this, but for system message HTML Tidy is not used (expensive).

Example Wikitext:

Text

  • item
  • item

is wrapped:

<div class='mw-history-legend'>
Text

  • item
  • item</div>

ParserOutput:

<div class="mw-history-legend">
<p>Text
</p>
<ul><li> item
</li><li> item</div>
</li></ul>


Version: unspecified
Severity: enhancement

Details

Reference
bz23699

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:00 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz23699.
bzimport added a subscriber: Unknown Object (MLST).

Created attachment 7413
untested patch for wrapWikiMsg in trunk

Attached: