Template:Escape template list: Difference between revisions

From Xenharmonic Wiki
Jump to navigation Jump to search
ArrowHead294 (talk | contribs)
mNo edit summary
ArrowHead294 (talk | contribs)
mNo edit summary
 
(48 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Certain characters and character sequences have special meanings in Wiki markup. Sometimes, they need to be escaped, and these templates are used to do so.<noinclude>
{| class="wikitable" style="text-align: center; <noinclude>margin: auto auto auto auto;</noinclude>"
 
{{Shortcut|esctl}}</noinclude>
 
{| class="wikitable" style="text-align: center;"
<includeonly>
<includeonly>
|+ style="font-size: 105%;" | [[Template:Escape template list|Template calls for escaping characters]]
|+ style="font-size: 105%;" | Template calls for escaping characters
</includeonly>
</includeonly>
|- style="white-space: nowrap;"
! Template call<includeonly>*</includeonly> !! Output<includeonly>**</includeonly> !! HTML alternative<includeonly>***</includeonly>
|-
|-
! {{nowrap|Template call}}<includeonly>{{ast}}</includeonly> !! {{nowrap|Output}}<includeonly>{{ast|2}}</includeonly> !! {{nowrap|HTML alternative}}<includeonly>{{ast|3}}</includeonly>
| {{tlx|!|plaincode}} '''(m)''' || <nowiki>|</nowiki> || {{plaincode|&amp;#124;}} or {{tlx|pipe|plaincode}}
|-
|-
| <code>{{((}}!{{))}}</code> '''(m)''' || &#124; || <code>&amp;#124;</code> or {{tl|pipe}}
| {{tlx|{{=}}|plaincode}} '''(m)''' || <nowiki>=</nowiki> || {{plaincode|&amp;#61;}}
|-
|-
| <code>{{((}}={{))}}</code> '''(m)''' || &#61; || <code>&amp;#61;</code>
| {{tlx|!!|plaincode}} || <nowiki>||</nowiki> || {{plaincode|&amp;#124;&amp;#124;}}
|-
|-
| {{tlx|!!}} || &#124;&#124; || <code>&amp;#124;&amp;#124;</code>
| {{tlx|!(|plaincode}} || <nowiki>[</nowiki> || {{plaincode|&amp;#91;}} or {{tlx|lbrack|plaincode}}
|-
|-
| {{tlx|!(}} || &#91; || <code>&amp;#91;</code> or {{tl|lbrack}}
| {{tlx|)!|plaincode}} || <nowiki>]</nowiki> || {{plaincode|&amp;#93;}} or {{tlx|rbrack|plaincode}}
|-
|-
| {{tlx|)!}} || &#93; || <code>&amp;#93;</code> or {{tl|rbrack}}
| {{tlx|!((|plaincode}} || <nowiki>[[</nowiki> || {{plaincode|&amp;#91;&amp;#91;}}
|-
|-
| {{tlx|!((}} || &#91;&#91; || <code>&amp;#91;&amp;#91;</code>
| {{tlx|))!|plaincode}} || <nowiki>]]</nowiki> || {{plaincode|&amp;#93;&amp;#93;}}
|-
|-
| {{tlx|))!}} || &#93;&#93; || <code>&amp;#93;&amp;#93;</code>
| {{tlx|(|plaincode}} || <nowiki>{</nowiki> || {{plaincode|&amp;#123;}}
|-
|-
| {{tlx|(}} || &#123; || <code>&amp;#123;</code>
| {{tlx|)|plaincode}} || <nowiki>}</nowiki> || {{plaincode|&amp;#125;}}
|-
|-
| {{tlx|)}} || &#125; || <code>&amp;#125;</code>
| {{tlx|((|plaincode}} || <nowiki>{{</nowiki> || {{plaincode|&amp;#123;&amp;#123;}}
|-
|-
| {{tlx|((}} || &#123;&#123; || <code>&amp;#123;&amp;#123;</code>
| {{tlx|))|plaincode}} || <nowiki>}}</nowiki> || {{plaincode|&amp;#125;&amp;#125;}}
|-
|-
| {{tlx|))}} || &#125;&#125; || <code>&amp;#125;&amp;#125;</code>
| {{tlx|(((|plaincode}} || <nowiki>{{{</nowiki> || {{plaincode|&amp;#123;&amp;#123;&amp;#123;}}
|-
|-
| {{tlx|(((}} || &#123;&#123;&#123; || <code>&amp;#123;&amp;#123;&amp;#123;</code>
| {{tlx|)))|plaincode}} || <nowiki>}}}</nowiki> || {{plaincode|&amp;#125;&amp;#125;&amp;#125;}}
|-
|-
| {{tlx|)))}} || &#125;&#125;&#125; || <code>&amp;#125;&amp;#125;&amp;#125;</code>
| {{tlx|(!|plaincode}} || <nowiki>{|</nowiki> || {{plaincode|&amp;#123;&amp;#124;}}
|-
|-
| {{tlx|(!}} || &#123;&#124; || <code>&amp;#123;&amp;#124;</code>
| {{tlx|!+|plaincode}} || <nowiki>|+</nowiki> || {{plaincode|&amp;#124;&amp;#43;}}
|-
|-
| {{tlx|!+}} || &#124;&#43; || <code>&amp;#124;&amp;#43;</code>
| {{tlx|!-|plaincode}} || <nowiki>|-</nowiki> || {{plaincode|&amp;#124;&amp;#45;}}
|-
|-
| {{tlx|!-}} || &#124;&#45; || <code>&amp;#124;&amp;#45;</code>
| {{tlx|!)|plaincode}} || <nowiki>|}</nowiki> || {{plaincode|&amp;#124;&amp;#125;}}
|-
|-
| {{tlx|!)}} || &#124;&#125; || <code>&amp;#124;&amp;#125;</code>
| {{tlx|&#39;|plaincode}} || &#39; || {{plaincode|&amp;#39;}}
|-
|-
| {{tlx|^(}} || &lt; || <code>&amp;#60;</code> or <code>&amp;lt;</code>
| {{tlx|colon|plaincode}} || <nowiki>:</nowiki> || {{plaincode|&amp;#58;}}
|-
|-
| {{tlx|)^}} || &gt; || <code>&amp;#62;</code> or <code>&amp;gt;</code>
| {{tlx|^(|plaincode}} || &lt; || {{plaincode|&amp;#60;}} or {{plaincode|&amp;lt;}}
|-
|-
| {{tlx|^((}} || &lt;&lt; || <code>&amp;#60;&amp;#60;</code> or <code>&amp;lt;&amp;lt;</code>
| {{tlx|)^|plaincode}} || &gt; || {{plaincode|&amp;#62;}} or {{plaincode|&amp;gt;}}
|-
|-
| {{tlx|))^}} || &gt;&gt; || <code>&amp;#62;&amp;#62;</code> or <code>&amp;gt;&amp;gt;</code>
| {{tlx|&#42;&#42;|plaincode}} || <nowiki>*</nowiki> || {{plaincode|&amp;#42;}}
|-
<includeonly>
| {{tlx|**}} || &#42; || <code>&amp;#42;</code> or {{tlx|asterisk}}
{{Navbar table|cols=3|Template:Escape template list}}
<includeonly>{{table notes|cols=3|fs=0.75em
</includeonly>
| '''m''' for magic word
|}
| Delayed interpretation as Wiki markup
<includeonly>
| Never interpreted as Wiki markup
<nowiki />* '''m''' for [[mw:Help:Magic words|magic word]]
}}</includeonly>
 
|}<noinclude>
<nowiki />** Delayed interpretation as Wiki markup
{{Documentation}}
 
<nowiki />*** Never interpreted as Wiki markup
</includeonly><noinclude>
{{documentation}}


[[Category:Character templates]]
[[Category:Character templates]]
[[Category:Tables]]
</noinclude>
</noinclude>

Latest revision as of 13:52, 7 May 2025

Template call Output HTML alternative
{{!}} (m) | &#124; or {{pipe}}
{{=}} (m) = &#61;
{{!!}} || &#124;&#124;
{{!(}} [ &#91; or {{lbrack}}
{{)!}} ] &#93; or {{rbrack}}
{{!((}} [[ &#91;&#91;
{{))!}} ]] &#93;&#93;
{{(}} { &#123;
{{)}} } &#125;
{{((}} {{ &#123;&#123;
{{))}} }} &#125;&#125;
{{(((}} {{{ &#123;&#123;&#123;
{{)))}} }}} &#125;&#125;&#125;
{{(!}} {| &#123;&#124;
{{!+}} |+ &#124;&#43;
{{!-}} |- &#124;&#45;
{{!)}} |} &#124;&#125;
{{'}} ' &#39;
{{colon}} : &#58;
{{^(}} < &#60; or &lt;
{{)^}} > &#62; or &gt;
{{**}} * &#42;
Template documentation[view] [edit] [history] [purge]
English Wikipedia has an article on:

Certain characters and character sequences have special meanings in Wiki markup. Sometimes, they need to be escaped, and these templates are used to do so.

Escaping these characters using templates simply delays their interpretation as Wiki markup, but if you type them using HTML entities or wrap them in <nowiki> tags, they will never be interpreted as markup.

Note: These escape templates should only be used when absolutely necessary, as overuse of such templates can make pages hard to read and edit in the source editor.

Usage

These templates are used to escape special character sequences, so that they are interpreted later than they would otherwise be. They are most useful when trying to include tables within other tables or templates.

The following example shows an instance of including a Wikitable within another Wikitable. This markup:

{| class="wikitable" style="text-align: center;"
|+ style="font-size: 105%;" | Caption text
|-
! Header text !! Header text
|-
| Example 1 || Example 2
|-
| Example 3 || Example 4
|-
| colspan="2" | {{(!}} class{{=}}"wikitable" style{{=}}"text-align: center;"
{{!+}} style{{=}}"font-size: 105%;" {{!}} Caption text
{{!-}}
! Header text !! Header text
{{!-}}
{{!}} Example 5 {{!!}} Example 6
{{!-}}
{{!}} Example 7 {{!!}} Example 8
{{!)}}
|}

gives:

Caption text
Header text Header text
Example 1 Example 2
Example 3 Example 4
Caption text
Header text Header text
Example 5 Example 6
Example 7 Example 8