Page MenuHomePhabricator

Line breaks added inside inside <onlyinclude>/<noinclude> markup that contains table/heading
Closed, ResolvedPublic

Description

this edit is made by a restricted VisualEiditor interface (Add-Link-Structured-Task) which only adds links so this is probably a Parsoid roundtrip issue. The old text is

<onlyinclude>{| ...
...
|}</onlyinclude>

the new text is

<onlyinclude>
{| ...
...
|}
</onlyinclude>

(the link edit was to a completely different part of the page).

Event Timeline

I couldn't reproduce readily with a bunch of simplified test cases on the command line. So, this looks like some edge case specific to this page, if at all.

Arlolra subscribed.

It's reproducible with,
https://ar.wikipedia.org/w/index.php?title=%D8%A8%D9%8A%D9%86%D9%8A_%D8%AF%D8%B1%D9%8A%D8%AF%D9%81%D9%88%D9%84_(%D9%85%D8%B3%D9%84%D8%B3%D9%84)&oldid=53445436&veaction=edit

It looks like what's being sent is,

<meta typeof="mw:Includes/OnlyInclude" id="mwXA"><table class="wikitable" style="text-align: center;" id="mwXQ">
<tbody id="mwXg"><tr id="mwXw">
...
</tbody></table><meta typeof="mw:Includes/OnlyInclude/End" id="mwgw">

and returned,

<meta typeof="mw:Includes/OnlyInclude"><table class="wikitable" style="text-align: center;" id="mwXQ">
<tbody id="mwXg"><tr id="mwXw">
...
</tbody></table><meta typeof="mw:Includes/OnlyInclude/End">

so the ids on the meta tags are being stripped, which makes Parsoid believe this is new content and normalizes it when serializing.

matmarex renamed this task from Dirty diff with newline changes for table inside <onlyinclude> to Line breaks added inside inside <onlyinclude>/<noinclude> markup that contains table/heading.Apr 6 2025, 8:19 PM
Restricted Application added a subscriber: alaa. · View Herald TranscriptApr 6 2025, 8:19 PM

Change #1134380 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/VisualEditor@master] ve.dm.MWIncludesNode: Preserve HTML attributes

https://gerrit.wikimedia.org/r/1134380

Change #1134380 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] ve.dm.MWIncludesNode: Preserve HTML attributes

https://gerrit.wikimedia.org/r/1134380

matmarex moved this task from Inbox to QA on the Editing-team (Kanban Board) board.
matmarex added a project: Editing QA.
matmarex subscribed.

That should fix it, but I'd also like to Editing team to double-check it. I hope you don't mind me putting this on your board, and can find some time to QA it. Thanks!

Ryasmeen edited projects, added Verified; removed Editing QA.
Ryasmeen subscribed.

I tested this on the page where it was reported originally by adding a link to a text. I don't see any line break being added inside the <onlyinclude> markup anymore.

Screenshot 2025-04-14 at 7.59.20 PM.png (1×2 px, 458 KB)

Is removing of all project tags expected, @VPuffetMichel? It is now much harder to find this task and to track previous work for those projects.