Page MenuHomePhabricator

Unrelated linebreak and whitespace changes when editing an infobox in Visual Editor
Closed, ResolvedPublic

Description

Not sure if this has been reported yet, but this is a really annoying bug within VE.

When someone uses VE to edit an infobox it does not just make the change the person enters but does a whole bunch of other adjusting of spacing within the infobox. And example can be seen here:

https://en.wikipedia.org/w/index.php?title=Testosterone&type=revision&diff=892468212&oldid=891980025&diffmode=source

If makes the diff viewer useless. Best

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 15 2019, 1:02 AM
Aklapper renamed this task from Formatting issues created by Visual Editor to Unrelated linebreak and whitespace changes when editing an infobox in Visual Editor.Apr 15 2019, 8:21 AM
JTannerWMF moved this task from To Triage to Freezer on the VisualEditor board.Tue, Apr 23, 3:48 PM
Esanders added a subscriber: Esanders.

Template:Chembox has block formatting in TemplateData, so this shouldn't be converting to inline. Tagging Parsoid.

Looks like Chembox templatedata is actually messed up. If you look closely at https://en.wikipedia.org/wiki/Template:Chembox/doc, the TOC has two "TemplateData" sections:

The second section is hidden inside the "Chembox templates" navbox and transcluded from https://en.wikipedia.org/wiki/Template:Cascite/doc. I actually have no idea how that transclusion happens. But the tiny templatedata for Cascite ends up overriding the templatedata for Chembox because of it.

I made this edit: https://en.wikipedia.org/w/index.php?title=Template:Cascite/doc&diff=prev&oldid=893794177&diffmode=source and purged https://en.wikipedia.org/wiki/Template:Chembox. That should fix the problem. I'm not really sure if that's the proper fix, hopefully someone more familiar with the templates can have a look… @DePiep?

Preventing multiple templatedata sections being transcluded is a good solution (good catch). I have adjusted the documentation set to prevent this in an other way (do not transclude a full /doc page in the navigationbox).

Shenme added a subscriber: Shenme.Mon, Apr 29, 12:59 AM

Would the above attempted fix have been implemented over on Wikipedia yet? I note this edit today (Apr 29) https://en.wikipedia.org/w/index.php?title=Legacies_(TV_series)&diff=prev&oldid=894628050 only added four characters, but VE added 255 more spaces? Since I see other editors removing excess spaces from Infoboxen, it seems VE is working against us?

Would the above attempted fix have been implemented over on Wikipedia yet? I note this edit today (Apr 29) https://en.wikipedia.org/w/index.php?title=Legacies_(TV_series)&diff=prev&oldid=894628050 only added four characters, but VE added 255 more spaces? Since I see other editors removing excess spaces from Infoboxen, it seems VE is working against us?

The number of spaces is decided by the format specified in the TemplateData: https://www.mediawiki.org/wiki/Help:TemplateData#Custom_formats

@Shenme To be precise, the number of spaces is defined on this page: https://en.wikipedia.org/w/index.php?title=Template:Infobox_television/doc&action=edit in the <templatedata> tag using this line : "format": "{{_\n| ________________________ = _\n}}\n",. It was made this way in this edit: https://en.wikipedia.org/w/index.php?title=Template:Infobox_television/doc&diff=prev&oldid=876006373. I suggest you coordinate with other editors if you want to change this format, we (developers) really have no involvement here.

There were no code changes on this task, I've only made a single Wikipedia template edit to fix the misconfiguration affecting the "Chembox" template.

I think there might actually be a (more minor) Parsoid issue here. Whitespace around the template parameters that contain the HTML comment "separators" like <!-- Names --> changes unexpectedly. (The space changes are expected, I guess, but losing the newlines is not.) In this diff I only edited the "ImageAlt1" parameter:

Esanders closed this task as Resolved.Tue, Apr 30, 1:42 PM
Esanders claimed this task.

The original reported issue was an on-wiki issue and appears to be resolved. If there are follow up issues let's file separately.

Restricted Application added a project: User-Ryasmeen. · View Herald TranscriptTue, Apr 30, 1:42 PM