Page MenuHomePhabricator

Linter does not detect P inside SPAN, where SPAN is inside DIV based content.
Open, LowPublicBUG REPORT


List of steps to reproduce (step by step, including full links if applicable):

What happens?:

The page is not listed as containing 'misnested' tags - namely the P inside the SPAN. (see T311769)

What should have happened instead?:

The page should have been listed as containing mis-nested content.

Event Timeline

Arlolra moved this task from Backlog to New Linters on the MediaWiki-extensions-Linter board.
Arlolra added a subscriber: Arlolra.

The breakage is because of T134469, similar to T303705#9103106 and T275475#9094307

From T311769,

The Linter extension should have generated a warning about the line-feeds inside SPAN based content, so they can be removed.

It's more about spans starting on the same line as a div than newlines in spans in general; doBlockLevels is doing line based analysis.

There are a number of ideas that would help, like typed templates to indicate an inline context or getting rid of doBlockLevels and only doing DOM based paragraph wrapping, like in Parsoid's post-processor or Remex. In any case, the ask here is for some form of detection before we get to that.