Problem statement
When you edit a template in the visual editor, it removes the old copy of the entire template and replaces it with a new copy of the whole template (even if you only edit one parameter). The visual editor always inserts templates according to the format specified in that template's documentation (look for a ==Template Data== section), or, if none exists, to the default formatting for that wiki.
Problem: Sometimes, the format specified in the template's documentation is not the format used in a specific article, or the format preferred by an individual editor. This can result in whitespace changes that make it difficult to read the diff.
Workaround
- Correct the TemplateData for that template.
- Make sure that the TemplateData and any sample copies of the template in the documentation are using the same format.
Explanation
Typing individual parameters on separate lines can mislead non-technical editors into thinking that each line is "one thing". As a result, people have an expectation that if they change "one thing" inside a template, then only "one thing" will be changed in the wikitext.
However, the entire template is "one thing", and changing any part of it causes all of it to be removed and replaced. This has some advantages (e.g., standardization, predictable ordering of parameters), but it can cause annoying diffs, especially if (a) it's early in the community's adoption of TemplateData, so most articles aren't already using the locally defined standard formatting, (b) the human-readable documentation doesn't match the TemplateData, so editors coping the wikitext samples are using a style that will be standardized later by the visual editor, or (c) someone changes the TemplateData to a different style (eventually triggering another round of whitespace changes, once per article).
Description from 2017
Hey all, so it seems recently Visual Editor has taken to removing whitespace from infoboxes by default. Ex: https://en.wikipedia.org/w/index.php?title=Ye_Hai_Mohabbatein&diff=806562609&oldid=805739169, https://en.wikipedia.org/w/index.php?title=Ishqbaaaz&diff=prev&oldid=806560482, https://en.wikipedia.org/w/index.php?title=2.0_(film)&diff=806958999&oldid=806721661, https://en.wikipedia.org/w/index.php?title=Bareilly_Ki_Barfi&diff=807726878&oldid=807726502. This is not constructive, as many editors and communities prefer that there be some element of infobox formatting to promote data legibility. For example, see https://en.wikipedia.org/wiki/Template:Infobox_film. Any help would be appreciated, because each of these edits is basically undoing a lot of editorss efforts with no discussion or policy/guideline-backed authority. Thanks,