Module: wt2html/pp/handlers/liFixups

Methods

(inner) handleLIHack()

For the following wikitext (called the "LI hack"):

    * <li class="..."> foo

the Parsoid parser, pre-post processing generates something like

    <li></li><li class="...">foo</li>

This visitor deletes such spurious <li>s to match the output of the PHP parser.

For the following wikitext (called the "LI hack"):

    * <li class="..."> foo

the Parsoid parser, pre-post processing generates something like

    <li></li><li class="...">foo</li>

This visitor deletes such spurious <li>s to match the output of the PHP parser.

However, note that the wikitext <li></li>, any preceding wikitext asterisk * absent, should indeed expand into two nodes in the DOM.

Source:

(inner) migrateTrailingCategories()

Earlier in the parsing pipeline, we suppress all newlines and other whitespace before categories which causes category links to be swallowed into preceding paragraphs and list items.

Earlier in the parsing pipeline, we suppress all newlines and other whitespace before categories which causes category links to be swallowed into preceding paragraphs and list items.

However, with wikitext like this: *a\n\n[[Category:Foo]], this could prevent proper roundtripping (because we suppress newlines when serializing list items). This needs addressing because this pattern is extremely common (some list at the end of the page followed by a list of categories for the page).

Source: