Page MenuHomePhabricator

Several {{Collapse top}} templates render incorrectly in Meta wiki
Open, LowPublic

Description

Several {{Collapse top}} templates render incorrectly in Meta wiki.

When editing via Visual Editor, I used several collapse templates to wrap JSON code on a page in Meta wiki. Even though in editing mode, the preview didn't show any errors, but after publishing the pages, I saw all collapsible items in a nested state. The specific revision that shows this:

https://meta.wikimedia.org/w/index.php?title=Contraband&diff=19197571&oldid=19195077

See below screenshot of published changes that shows a leftover markup |} that I didn't see in the editing mode.

Screen Shot 2019-07-12 at 1.15.08 PM.png (1×2 px, 126 KB)

See screenshot below that shows all nested collapsible items.

Screen Shot 2019-07-12 at 1.15.36 PM.png (544×1 px, 98 KB)

The same content rendered well on MediaWiki.

Event Timeline

The {{Collapse bottom}} template generates the |}, and for it to work correctly as an end-of-table markup, it must be on a separate line. In the diff you linked, it was placed by Parsoid on the same line as the closing </syntaxhighlight> tag.

@matmarex Indeed that did the trick! But, ideally, there is a way to auto-detect/ fix this?

JTannerWMF moved this task from To Triage to Freezer on the VisualEditor board.
JTannerWMF added a subscriber: JTannerWMF.

The Editing-team believes this ticket should be looked at by Parsoid, we are not prioritizing at this time.

The {{Collapse bottom}} template generates the |}, and for it to work correctly as an end-of-table markup, it must be on a separate line. In the diff you linked, it was placed by Parsoid on the same line as the closing </syntaxhighlight> tag.

Parsoid doesn't know it needs to be a on a separate line ... does templatedata format specify this?

LGoto triaged this task as Low priority.May 1 2020, 4:13 PM
LGoto moved this task from Backlog to Needs Investigation on the Parsoid board.
Arlolra added a subscriber: Arlolra.

Parsoid doesn't know it needs to be a on a separate line ... does templatedata format specify this?

Doesn't seem like it.

"notemplatedata":""

https://meta.wikimedia.org/w/api.php?action=templatedata&titles=Template:Collapse%20bottom&format=json&includeMissingTitles=1