Page MenuHomePhabricator

Parsoid on serialisation should use the `format` field from TemplateData if available to set the whitespace formatting of new/edited transclusions
Closed, ResolvedPublic0 Story Points

Description

Per this feedback, break-lines are missing when infoboxes or categories are inserted.
For the record, I've already heard people on French Wikipedia complaining about it.

Expectation:
{{Писатель

Жанр = [[Фэнтези]]
Изображение =
Сайт =
Имя = Ричард Бейкер
Род деятельности = писатель-фантаст, гейм-дизайнер

}}

Reality:
{{Писатель | Жанр = [[Фэнтези]] | Изображение = | Сайт = | Имя = Ричард Бейкер | Род деятельности = писатель-фантаст, гейм-дизайнер}}

Event Timeline

Trizek-WMF raised the priority of this task from to Needs Triage.
Trizek-WMF updated the task description. (Show Details)
Trizek-WMF added a project: VisualEditor.
Trizek-WMF added a subscriber: Trizek-WMF.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 7 2015, 8:56 AM
Esanders set Security to None.
Esanders added a subscriber: Esanders.

Not sure how you can decide which to use. In some cases inline is much more sensible, e.g. "It is {{convert|50|km|miles}} high"

Maybe add a parameter in the templatedata?

ssastry added a subscriber: ssastry.Sep 8 2015, 3:26 PM

Not possible for Parsoid to automatically know what is the right thing to do. Requires some templatedata information about serialization preferences.

Not possible for Parsoid to automatically know what is the right thing to do. Requires some templatedata information about serialization preferences.

Should we turn this into a Once-T64147-is-solved-Parsoid-should-listen-to-it?

I get an other feedback which may be related: a user expect VE to recognize where a Template is not supposed to be inserted. Like an infobox in the middle of a sentence.
If we can indicate something about serialization in a way or an other, it may be possible to choose a Template position in the text?

Jdforrester-WMF triaged this task as Low priority.Sep 8 2015, 6:55 PM
Jdforrester-WMF moved this task from To Triage to Freezer on the VisualEditor board.
Elitre added a subscriber: Elitre.Oct 19 2015, 11:25 AM
Jdforrester-WMF renamed this task from Break lines are missing while inserting infoboxes or categories with VisualEditor to Parsoid on serialisation should use the `format` field from TemplateData if available to set the whitespace formatting of new/edited transclusions.Oct 19 2015, 5:41 PM
Jdforrester-WMF raised the priority of this task from Low to High.
Jdforrester-WMF added a project: TemplateData.
Jdforrester-WMF edited a custom field.

Now we've (finally!) added this feature to TemplateData, it'd be great if this could be done soon-ish. https://gerrit.wikimedia.org/r/#/c/243138/13/Specification.md details the specification of what counts as the format to use.

Adding a parameter to templatedata to set preferences for formatting templates in wikitext requires having templatedata for every template. With a lot of templates still missing template data this might become a trap. Or, I would rather prefer 'block' as default than 'inline'. Without templatedata or without the parameter being set this would format the wikitext as written under Description under Expectation:. I do agree there are some cases inline use is much more preferable. My guess is that those case are small in number compared to the other case, and are more likely to already have templatedata.

This decision was made in T64147: Add an option in TemplateData to specify desired wikitext whitespace formatting of parameters and this isn't really the venue, but will reply here:

Adding a parameter to templatedata to set preferences for formatting templates in wikitext requires having templatedata for every template. With a lot of templates still missing template data this might become a trap.

I don't understand? Yes, to be useful every template needs its TemplateData to be written.

Or, I would rather prefer 'block' as default than 'inline'. Without templatedata or without the parameter being set this would format the wikitext as written under Description under Expectation:. I do agree there are some cases inline use is much more preferable. My guess is that those case are small in number compared to the other case, and are more likely to already have templatedata.

I think you're under-estimating how badly breaking this would be for the majority of uses. There are quite a few templates, especially ones inside infoboxes and succession boxes, where setting the wrong layout means they do not work. Inline is the current behaviour and only rarely has issues. This would not be the case if we reversed the default.

AdHuikeshoven added a comment.EditedNov 13 2015, 10:28 PM

James,

Thanks for the reply. Typing from phone. Watching television, terror in
Paris. Romaine sees some blockers including this one.

I had an irc conversation with a Dutch user who doesn't want to be quoted.
For him ve might have been introduced to anonomous users yesterday on nl
wp.

Feel good have a nice day a good weekend. Peace love and hugs from Holland.

Ad

ssastry moved this task from Backlog to Next Up on the Parsoid board.Dec 17 2015, 5:43 PM
ssastry claimed this task.Dec 21 2015, 6:55 PM
ssastry moved this task from Next Up to In Progress on the Parsoid board.Dec 21 2015, 7:05 PM
Krenair moved this task from Backlog to External on the TemplateData board.Jan 12 2016, 11:55 PM

Change 264043 had a related patch set uploaded (by Subramanya Sastry):
WIP: Fetch and use templatedata

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

Change 264043 merged by jenkins-bot:
Fetch and use templatedata while serializing transclusions

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

https://gerrit.wikimedia.org/r/#/c/271933/ is the followup that needs to be completed before this is ready for deploy. This followup was necessitated after round trip testing revealed that the first patch introduce lots of dirty diffs for some inline-format transclusions.

ssastry moved this task from To Triage to Not ready to announce on the User-notice board.
ssastry closed this task as Resolved.Feb 24 2016, 10:38 PM