Topic on Help talk:TemplateData

TheGEICOgecko (talkcontribs)

I've recently realized a problem in which Visual Editor keeps adding additional speces to every single field when I edit one. This is an example:

| streetaddress           = 154 Warren C Coleman Blvd N
| city                    = Concord
| state                   = North Carolina
| province                = 
| country                 = United States
| coordinates             = 
| type                    = Private co-educational elementary & secondary
| established             = 1976

I've been told that the problem is a hidden "format" code within Visual Editor's TemplateData programming code for a template, or something that. If this is true, what does that mean exactly, and should I be concerned with removing it, or is it OK? I don't see the problem with the field values aligning, but I've recieved a complaint, and I just want to make sure that either it's acceptable for my VisualEditor to format the infobox like this, or that I fix it so it doesn't format it differently from what is acceptable.

Whatamidoing (WMF) (talkcontribs)

This format was selected at https://en.wikipedia.org/wiki/Template:Infobox_school/doc#TemplateData, which contains a line that says "format": "{{_\n | _______________________ = _\n}}",

The visual editor doesn't change the article "line by line". It changes it "thing by thing". So if you edit a template (any template), the old version of the whole thing gets removed, and the new version of the whole thing gets inserted. The new version will always use the formatting specified for the template (which is either the single-line default (like {{fact|date=April 2020}}), or whatever is chosen for that template (which is what happens here; most infoboxes contain this code or something very similar). There is no way to make it figure out what the formatting style was for the old version of this template on this page and stick to that.

So theoretically, you could remove this code, or swap in a formatting code that matches the one article where someone complained, but then all the articles that use this formatting would get changed the next time you edited their infoboxes. Unless most of them use a different (but matching each other) whitespace style, it might be better to leave well enough alone.