Jump to content

Template:Wrap at/doc

From Wikipedia, the free encyclopedia

This template inserts a 'line feed' (&#10; or &NewLine;) character between each of the parameters, and wraps the entire output in a <span>...</span> with the CSS property style="white-space: pre-line;".

The purpose of this template is to force-wrap short lines of text, such as in table headers and table cells, without using HTML <br /> tags. <br /> can cause screen-reader issues, such as inserting long pauses or stating a line break. Screenreaders reading text output from this template should sound as if the text were one continuous line (including any punctuation, if part of the text given as parameters).

Usage

[edit]
{{wrap at|first param|second param|third param|...}}

Example

{{wrap at|This text should|wrap at every|three words. See?}}

produces:

This text should wrap at every three words. See?

Disabling linebreaking

If this template is wrapped with the {{nowrap}} template, or is wrapped with a parent HTML object with {{{1}}} defined, the output will not be broken into lines; it will appear as one continuous space-separated string of text. Note that no space-replacement is performed; non-breaking spaces and similar are respected, and reproduced in the output.

Parameters

[edit]
  • Positional parameters (1, 2, 3...): these are the chunks of text that will be broken/separated by new line characters.