User:Interiot/Gaps at top of articles

One of my pet peeves is gaps at the top of articles. (example: before and after)

The problem is exacerbated by a few things: 1) It's a relatively trivial change, so some would argue that it's not worth creating a new history entry just to fix the problem, 2) Many people don't seem to notice the problem (so even when they are editing the article to make major fixes, they don't fix this as well), and 3) even if editors do notice the problem, it can be sometimes very difficult to fix, and may require a good knowledge of wiki syntax.

Too trivial to fix

edit

It is generally considered good form to avoid making extremely trivial edits (such as converting underscores to spaces in a piped link, or adjusting spacing, or similar edits which have minimal impact on the article's appearance) by themselves, and to only perform such cleanup if you're making more substantial edits to an article at the same time. This is particularly true for larger cleanup efforts (for example, using AWB or a bot to cleanup many pages at once).

However, since many people either don't notice the problem (see point #2), or don't know how to fix it (see point #3), this problem usually doesn't get fixed when more major changes are being made, so I personally feel that the problem should be fixed as soon as practical.

Causes

edit

There are numerous causes of extra gaps, some more difficult to fix than others.

The most obvious cause of the issue is extra blank lines in the article (usually, one blank line starts a new paragraph, while two blank lines will cause an extra gap to form). Similarly, using extra <br>s will add extra gaps. [1]

In other cases, if text is commented-out, and if it's combined with a blank line, that can cause an extra gap. In particular, bots that comment out images or other text frequently cause this problem. [2] [3] The problem can be fixed by moving either the <!-- or --> up/down to the neighboring blank line. [4]

The most difficult case to fix is when the problem is caused by a template, usually an infobox. The easiest way to identify this is to either remove the infobox, or run the infobox through Special:ExpandTemplates and examine its output. Special:ExpandTemplates in particular is invaluable in diagnosing these kinds of problems. Infoboxes can cause extra lines to be added in a variety of ways, from extra blank lines (even a single blank line in a template can combine with an extra line in the article to form an extra gap) [5], to incorrect placement of <noinclude> [6], to much more complicated issues such as using | when {{!}} should be used instead [7], or intermixing <td>-style table syntax with |+ |--style syntax [8].