Page MenuHomePhabricator

Parsoid does not add newlines between parameters in new template invocations, making wikitext difficult to read
Closed, ResolvedPublic

Description

Author: kwwilliams

Description:
There have been some bug reports focusing on the ordering of template arguments, but there's also a problem with changing the basic layout of the templates. Look at http://en.wikipedia.org/w/index.php?title=Raven-Symon%C3%A9&diff=563794138&oldid=563793891 where a vandal changed the birthname. The parameter order has been maintained, but the diff is still virtually useless because of the spurious formatting change. If the editor changes the value of one parameter to a template, that change is all that should be made to the source.


Version: unspecified
Severity: normal

Details

Reference
bz51175

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 1:44 AM
bzimport set Reference to bz51175.

Agreed; this is true for existing templates, but it's also an issue when adding a long infobox to a page, for example.

It was suggested by French Wikipedians to add a tag to TemplateData (like '"collapsed" = false') that would indicate to VisualEditor that the community consensus for a given template is to have one parameter per line, instead of cramming everything together (which could remain as the default behavior, and makes sense for many short templates).

I think the idea of a TemplateData tag as to whether to keep new lines seems like a good one, if Parsoid would be interested.

wicke wrote:

Looks like VE bug 51150. Closing as duplicate.

*** This bug has been marked as a duplicate of bug 51150 ***

The dirty diff is not the question here. Clarifying title.

In that case this is duplicate of bug 51003.

  • This bug has been marked as a duplicate of bug 51003 ***

kwwilliams wrote:

This is *not* a duplicate of 51003. You need to maintain the original formatting, not any suggested formatting. If the original source lists the parameters like

{{name

arg1arg2
arg3
arg4
arg5

}}

and someone changes arg2, all that should occur is that the value of arg2 should be changed. No braces should move. No newlines should be inserted or removed. The "dirty diff" is *precisely* what I am complaining about.

The various bugs around allowing a suggested format are all valid, but this isn't a duplicate. Diff lists are how we detect what editors have changed, and anything that dirties a diff is generally a bad thing. Reformatting templates when an argument is modified causes dirty diffs.

You have a choice of bug here, but it will be either 51150 (dirty diff) or 51003 (match style for new parameters and use appropriate style for new transclusions).

Bug 51150 seems to be rare these days when you look at the VE recentchanges diffs, but there still seem to be some recent examples of it occuring, which is why it was reopened.

VE recent changes on enwiki:
https://en.wikipedia.org/w/index.php?title=Special:RecentChanges&limit=100&tagfilter=visualeditor