Page MenuHomePhabricator

DL tag not nested correctly generate lint error
Open, LowPublic

Description

As described in https://it.wikivoyage.org/wiki/Utente:Andyrom75/Test2 the rendering of ":" (i.e. DL) is pushed out from the DIV where is located creating a lint error.

Since Template:Listing is one of the fundamental and most spread template in Wikivoyage, it produces thousands of lint errors along all the language versions.

Can this be fixed?

Event Timeline

Inside the mentioned page, I've added a case that show where the parser has inserted the second row outside the LI tag creating a layout issue and the graphical fix will generate a lint error.

On en:voy they insert <BR /> tag to avoid lint error but complicating the wikicode.

Is this parser beaviour fixable?

Arlolra moved this task from Backlog to New Linters on the MediaWiki-extensions-Linter board.
Arlolra subscribed.

It looks like https://it.wikivoyage.org/wiki/Modulo:Listing is doing a lot of work to escape newlines found in the "descrizione" because the template is typically used in a single line context, like a list item.

List items in wikitext are terminated by a newline. For example,

* A newline
* in a list  
marks the end of the list.

from https://www.mediawiki.org/wiki/Help:Lists#A_little_bit_further

This behaviour shouldn't be specific to dl tags though.

For example, if you had,

* {{1x|first
second}}

it's going to be expanded to,

* first
second

and rendered as,

<ul><li>first</li></ul>
<p>second
</p>

There are proposals around for typed templates, like https://www.mediawiki.org/wiki/Parsing/Notes/Wikitext_2.0/Typed_Templates, that could help.