From Pittsburgh Streets

The {{newline}} template produces a newline in the wikitext that will not be stripped by a whitespace left-trim operation, e.g., at the beginning of the "then" or "else" parts of #if: see Help:Extension:ParserFunctions § Stripping whitespace.

This template can also be useful simply to make a significant newline visible.

Newlines in wikitext are important when generating tables, for example. Many bits of wikitext table syntax, such as |- and |, must come at the beginning of a line (ignoring leading spaces): see Help:Tables.

This template is not quite "pure": it expands to <nowiki/> followed by a newline. This has two effects:

  1. It leaves a <nowiki/> at the end of the preceding line. I don't know of any problems that this can cause.
  2. The newline at the end is not "protected" by anything, so it will be stripped by a whitespace right-trim operation, e.g., at the end of the "then" or "else" parts of #if.

A workaround for the latter is to add a <nowiki/> afterward. If this were done in the {{newline}} template itself, however, it would destroy the usefulness of this template for creating tables: something like {{newline}}|- would put a <nowiki/> before the |-, which is not allowed.

Usage example

{| class="wikitable"
! Street
! Year
| Grant Street
| 1784<!--
  -->{{newline}}{{!}} Sandusky Street<!--
  -->{{newline}}{{!}} 1788
  -->{{newline}}{{!}} Second Street<!--
  -->{{newline}}{{!}} 1875
| Boulevard of the Allies
| 1922
Street Year
Grant Street 1784
Sandusky Street 1788
Boulevard of the Allies 1922