Difference between revisions of "Template:!"

From LCA2015 Delegate wiki
Jump to: navigation, search
(Created a metatemplate for the pipe character.)
 
m (Minor fixing of spacing in the template documentation.)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
|<noinclude>{{/Doc}}</noinclude>
+
<includeonly>|</includeonly><noinclude>This is an auxiliary template allowing the pipe character "|" to be encoded within template parameters. The "|" delimiter for a Wiki table has to be escaped by a template if it's used within a template.
 +
 
 +
This template can be used to parse tables correctly in templates. For example, the table:
 +
<pre>
 +
{| some table
 +
|- some row
 +
| some cell
 +
|
 +
|}
 +
}}
 +
</pre>
 +
Can be written as:
 +
<pre>
 +
{{sometemplate|someparameter={
 +
    {{!}} some table
 +
    {{!}}- some row
 +
    {{!}} some cell
 +
    {{!}}
 +
    {{!}}
 +
  }
 +
}}
 +
</pre>
 +
[[Category:Metatemplates]]
 +
</noinclude>

Latest revision as of 14:21, 9 December 2014

This is an auxiliary template allowing the pipe character "|" to be encoded within template parameters. The "|" delimiter for a Wiki table has to be escaped by a template if it's used within a template.

This template can be used to parse tables correctly in templates. For example, the table:

{| some table
|- some row
| some cell
|
|}
}}

Can be written as:

{{sometemplate|someparameter={
    {{!}} some table
    {{!}}- some row
    {{!}} some cell
    {{!}}
    {{!}}
  }
}}