Template:Nw: Difference between revisions

From the Super Mario Wiki, the Mario encyclopedia
Jump to navigationJump to search
mNo edit summary
mNo edit summary
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<includeonly><span style="white-space:nowrap;">{{{1}}}</span></includeonly><noinclude>This is the <nowiki>{{</nowiki>'''nowrap'''<nowiki>}}</nowiki> template.
<includeonly><span style="white-space:nowrap">{{{1}}}</span></includeonly><noinclude>
Short for '''no wrap''', this template prevents word wraps (line breaks) in text and links that contain spaces.


This template prevents word wraps (line breaks) in text and links that contain spaces.  
Before you use this template, you might want to read up on [[wikipedia:Help:Line-break handling|line-break handling]].


Before you use this template you might want to read up on [[wikipedia:Wikipedia:Line break handling|Wikipedia:Line break handling]].
== Usage ==
<code><nowiki>{{nw|Will not wrap}}</nowiki></code> or <code><nowiki>{{nw|[[Super Mario 64]]}}</nowiki></code>


=== Usage ===
<pre>
Lots of text {{nowrap|10 kg (22 lb)}} more text.
</pre>
It may render like this:
:Lots of text 10 kg (22 lb)
:more text.
Or like this:
:Lots of text
:10 kg (22 lb) more text.
But it will ''not'' render like this:
:Lots of text 10 kg (22
:lb) more text.
=== Handling interpreted characters ===
[[Help:Template|Templates]] have problems to handle parameter data that contains equal signs "<code>=</code>" or vertical bars "<code>|</code>". But there are also workarounds:
For text that includes an equal sign "=", precede the text with <code>1=</code>. For example:
:<code><nowiki>{{nowrap|</nowiki>1=2 + 2 = 4}}</code>
Which renders this:
:{{nowrap|1=2 + 2 = 4}}
For text that includes a vertical bar "|", escape the bar(s) with <code><nowiki>&amp;#124;</nowiki></code> or <code><nowiki>{{!}}</nowiki></code>. For instance like this:
:<code><nowiki>{{nowrap|</nowiki>&amp;#124;2&amp;#124; < 3}}</code>
Or like this:
:<code><nowiki>{{nowrap|{{!}}2{{!}} < 3}}</nowiki></code>
Which renders this:
:{{nowrap|&#124;2&#124; < 3}}
=== Technical details ===
The actual code that does the job is this HTML+CSS code:
:<code><nowiki><span style="white-space:nowrap">This text will not wrap</span></nowiki></code>
Spaces at the beginning or end of your text will fall outside the no-wrap tag in the rendered text due to Wikimedia rendering mechanisms.
[[Category:Formatting templates]]</noinclude>
[[Category:Formatting templates]]</noinclude>

Latest revision as of 10:35, June 4, 2024

Short for no wrap, this template prevents word wraps (line breaks) in text and links that contain spaces.

Before you use this template, you might want to read up on line-break handling.

Usage

{{nw|Will not wrap}} or {{nw|[[Super Mario 64]]}}