Open main menu

Changes

1,592 bytes added ,  04:12, 19 February 2016
m
1 revision imported: All the templates from MediaWiki.com
<noinclude>{{Documentation subpage}}
{{timw|Cnw}}</noinclude>

Combination of <'''c'''ode> and <'''n'''o'''w'''iki>.

Unlike with {{cnw|<p|re>}}, wrapping still works.

==Usage==
Write "|" between braces of the wikitext to be displayed (and if its last character is a closing brace, also after that), and also inside tags, to avoid their interpretation by the server.

Write "|" in the desired wikitext as {{cnw|{|{!}|}|}}.

----
{{cnw|a{|{cnw{{!}}'''bold''' ''italics'' {{{!}}{tc}{{!}}} [[link]] '''bold''' ''italics'' '''bold''' ''italics''}|}b}}
----
gives:
----
a{{cnw|'''bold''' ''italics'' {|{tc}|} [[link]] '''bold''' ''italics'' '''bold''' ''italics''}}b
----

If a line of wikitext has man braces and/or pipes it is easier to use '''{{cnw|<|code><|nowiki>..<|/nowiki><|/code>}}'''.

==Limitations==
The "|" does not avoid interpretation by the ''browser''. For example, a code like {{cnw|&amp;rarr;}} is not shown but interpreted by the browser. Also, both a single and multiple newlines are displayed as a space by the browser.

----<pre>
{{cnw|arrow &amp;rarr; {{tc}}

''italics''
[[link]]}}
</pre>
----
gives:
----
{{cnw|arrow &rarr; {{tc}}

''italics''
[[link]]}}
----

To preserve paragraphs, apply the template for each line separately. To preserve also single newlines, use also {{cnw|<|poem>}} tags.
----<pre>
<poem>
{{cnw|{|{tc}|}}}

{{cnw|''italics''}}
{{cnw|[[link]]}}
</poem>
</pre>
----
gives:
----
<poem>
{{cnw|{|{tc}|}}}

{{cnw|''italics''}}
{{cnw|[[link]]}}
</poem>
----

==See also==
*[[m:Template:Cnw]]
<includeonly>
[[Category:Templates]]
</includeonly>