Шаблон:Cnw — различия между версиями
(Combination of <nowiki> and <code>) |
Hubbitus (обсуждение | вклад) м (1 версия: Import templates from MediaWiki) |
(нет различий)
|
Текущая версия на 12:40, 8 февраля 2013
Combination of <code> and <nowiki>.
Unlike with <pre>
, 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 {{!}}
.
a{{cnw|'''bold''' ''italics'' {|{tc}|} [[link]] '''bold''' ''italics'' '''bold''' ''italics''}}b
gives:
a'''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 <code><nowiki>..</nowiki></code>
.
Limitations
The "|" does not avoid interpretation by the browser. For example, a code like →
is not shown but interpreted by the browser. Also, both a single and multiple newlines are displayed as a space by the browser.
{{cnw|arrow → {{tc}} ''italics'' [[link]]}}
gives:
arrow → in
''italics''
[[link]]
To preserve paragraphs, apply the template for each line separately. To preserve also single newlines, use also <poem>
tags.
<poem> {{cnw|{|{tc}|}}} {{cnw|''italics''}} {{cnw|[[link]]}} </poem>
gives:
<poem>
{{tc}
}
''italics''
[[link]]
</poem>
See also
The above documentation is transcluded from Шаблон:Cnw/doc. (edit | history) Editors can experiment in this template's sandbox (create) and testcases (create) pages. Please add categories and interwikis to the /doc subpage. Subpages of this template. |