Template:Nowrap/doc: Difference between revisions
ArrowHead294 (talk | contribs) mNo edit summary |
ArrowHead294 (talk | contribs) mNo edit summary |
||
Line 1: | Line 1: | ||
{{dochead}} | {{dochead}}{{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. | ||
=== Usage === | === Usage === | ||
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. | 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> | 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" | ||
Line 13: | Line 13: | ||
! Rendered output | ! Rendered output | ||
|- | |- | ||
| {{{{ROOTPAGENAME}}|<code><nowiki> | | {{{{ROOTPAGENAME}}|<code>{<nowiki />{nowrap|10 kg (22 lb)}}</code>}} | ||
| <syntaxhighlight lang="html"><span style="white-space: nowrap;">10 kg (22 lb)</span></syntaxhighlight> | | <syntaxhighlight lang="html"><span style="white-space: nowrap;">10 kg (22 lb)</span></syntaxhighlight> | ||
| {{{{ROOTPAGENAME}}|10 kg (22 lb)}} | | {{{{ROOTPAGENAME}}|10 kg (22 lb)}} | ||
|- | |- | ||
| {{{{ROOTPAGENAME}}|<code><nowiki> | | {{{{ROOTPAGENAME}}|<code>{<nowiki />{nowrap|1 Jan|2 Feb|3 Mar|4 Apr}}</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> | | <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}} | | {{{{ROOTPAGENAME}}|1 Jan|2 Feb|3 Mar|4 Apr}} |