Page MenuHomePhabricator

VE should respect/preserve original block formatting in block template (comments between template parameters)
Open, Needs TriagePublic

Description

See this edit: https://cs.wikipedia.org/w/index.php?title=Argon&curid=5013&diff=17332615&oldid=17244512&diffmode=source

VE tries to block-format the infobox, which is already block-formatted, but VE makes the formatting broken because of comments.

The comments here are marking the headings for individual sections (because of the length of the blank infobox) and need to be inbetween the params, not on the same line.

Also VE removes the initial spaces of each line, which we on Czech Wikipedia preserve - the original editor has a free choice of how many (if any) initial spaces his block template will have and bots and other editors should respect the original editor choice.

Event Timeline

Dvorapa created this task.Jun 8 2019, 11:42 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 8 2019, 11:42 AM
Dvorapa updated the task description. (Show Details)Jun 8 2019, 11:44 AM
Dvorapa renamed this task from VE should respect/preserve comments in block template formatting to VE should respect/preserve original block formatting in block template.Jun 8 2019, 11:50 AM
Dvorapa updated the task description. (Show Details)
marcella assigned this task to matmarex.Jun 18 2019, 3:22 PM
marcella edited projects, added VisualEditor (Current work); removed VisualEditor.
Dvorapa updated the task description. (Show Details)Jun 18 2019, 3:26 PM
matmarex edited projects, added Parsoid; removed TemplateData.Jun 18 2019, 8:33 PM

"format": "block" in templatedata instructs Parsoid to reformat the template, and that's why the initial spaces are removed. This is the expected behavior. To avoid this, you can define a custom format if the spaces are always desirable (https://www.mediawiki.org/wiki/Help:TemplateData#Custom_formats), or you can remove the "format": "block" so that existing formatting will be preserved.

But I think whatever happened to the comments inside the template is unexpected… Note that this happens in Parsoid rather than VisualEditor.

matmarex renamed this task from VE should respect/preserve original block formatting in block template to VE should respect/preserve original block formatting in block template (comments between template parameters).Jun 18 2019, 8:34 PM
matmarex removed matmarex as the assignee of this task.
matmarex moved this task from Current work to External and Administrivia on the VisualEditor board.
matmarex edited projects, added VisualEditor; removed VisualEditor (Current work).
matmarex added a subscriber: matmarex.

Okay, but by removing format block new infoboxes will be formatted inline, which is not desired (obviously). And by setting a different value the current spaces won't be preserved. There is no such option "block when inserting, but leave as is otherwise". This issue was recently a dispute between bot owners on Czech Wikipedia and we finally agreed on a compromise to adjust our bots to leave the number of initial spaces on each line as is (if block formatting there is not broken of course).