Template:Nowrap/doc: Difference between revisions
ArrowHead294 (talk | contribs) mNo edit summary |
ArrowHead294 (talk | contribs) mNo edit summary |
||
(12 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{dochead}} | {{dochead}}{{Wikipedia}}{{lua|Variable arguments}} | ||
{{Wikipedia}} | The <code>{<nowiki />{nowrap}}</code> template stops wrapping of specific text that may happen at spaces, dashes, or parentheses. It is to be used for sections such as units, dates, and mathematical equations that should always stay together. | ||
The <code> | |||
=== Usage === | === Usage === | ||
Pass in the text to be held together as a single unnamed parameter. | Pass in the text to be held together as a single unnamed parameter. Two or more unnamed parameters will result in individual chunks of non-wrapped text separated by a comma and space. | ||
Leading and trailing whitespaces in the input parameters will be trimmed. Interior whitespaces will not wrap, but the spaces separating the generated <code><<nowiki />span></code> elements are ordinary spaces and will wrap by default. | |||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
| <code><nowiki>{{nowrap|10 kg (22 lb)}}</nowiki></code> | ! You type | ||
! Generated HTML | |||
! Rendered output | |||
|- | |||
| {{{{ROOTPAGENAME}}|<code><nowiki>{{nowrap|10 kg (22 lb)}}</nowiki></code>}} | |||
| <syntaxhighlight lang="html"><span style="white-space: nowrap;">10 kg (22 lb)</span></syntaxhighlight> | |||
| {{{{ROOTPAGENAME}}|10 kg (22 lb)}} | |||
|- | |- | ||
| <code><nowiki>{{nowrap| 1 Jan | 2 Feb | 3 Mar }}</nowiki></code> | | {{{{ROOTPAGENAME}}|<code><nowiki>{{nowrap|1 Jan|2 Feb|3 Mar|4 Apr}}</nowiki></code>}} | ||
| <syntaxhighlight lang="html"><span style="white-space: nowrap;">1 Jan</span>, <span style="white-space: nowrap;">2 Feb</span>, <span style="white-space: nowrap;">3 Mar</span>, <span style="white-space: nowrap;">4 Apr</span></syntaxhighlight> | |||
| {{{{ROOTPAGENAME}}|1 Jan|2 Feb|3 Mar|4 Apr}} | |||
|} | |} | ||
{{escape notice}} | {{escape notice}} |