Template:Block bug documentation: Difference between revisions

Nothing to hide, but nothing to show you either.
Jump to navigation Jump to search
Content added Content deleted
(add attribution (via JWB))
 
(5 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<noinclude>{{notice|Ignore any errors showing below; they do not appear when this snippet is transcluded (nor does this message box). This doc snippet's output only works when it's transcluded into the context of a specific template, e.g. at [[Template:Block indent/doc]]}}
<noinclude>{{notice|Ignore any errors showing below; they do not appear when this snippet is transcluded (nor does this message box). This doc snippet's output only works when it's transcluded into the context of a specific template, e.g. at [[Template:Block indent/doc]]}}


</noinclude>If the block-formatted content begins with a list (or any other wikimarkup that is dependent upon a specific markup character being at the beginning of a line) then due to a bug in [[MediaWiki]], a <code>&lt;nowiki /&gt;</code> must exist before the list (or whatever) starts. Compare:
</noinclude>If the block-formatted content begins with a list (or any other wikimarkup that is dependent upon a specific markup character being at the beginning of a line) then due to a bug in [[MediaWiki]], a {{xtag|nowiki|s}} must exist before the list (or whatever) starts. Compare:
{| class="wikitable"
{| class="wikitable"
|-
|-
Line 34: Line 34:
}}</includeonly><noinclude>{{error|This output only works when this doc snippet is transcluded.}}</noinclude>
}}</includeonly><noinclude>{{error|This output only works when this doc snippet is transcluded.}}</noinclude>
|}
|}
To embed a template in block markup like this, the block template's content parameter must be named or numbered and include the self-closing noinclude – as in <code><nowiki>|1=&lt;nowiki /&gt;</nowiki></code> – then every <code><nowiki>|</nowiki></code> character in the template markup must be escaped with {{tlx|!}}. An alternative is to use explicit HTML {{tag|table|o}}, {{tag|tr|o}}, {{tag|th|o}}, and {{tag|td|o}} markup.<noinclude>
To embed a table in block markup like this, the block template's content parameter must be named or numbered and include the self-closing noinclude – as in <code><nowiki>|1=&lt;nowiki /&gt;</nowiki></code> – then every <code><nowiki>|</nowiki></code> character in the table markup must be escaped with {{tlx|!}}. An alternative is to use explicit HTML {{code|lang=html|code=<table>}}, {{code|lang=html|code=<tr>}}, {{code|lang=html|code=<th>}}, and {{code|lang=html|code=<td>}} markup.<noinclude>
{{Documentation|content=This is transcluded documentation, which can be transcluded in the /doc pages of various templates like {{tlx|Block indent}} and {{tlx|Quote}}, e.g. under a "Technical issue with block templates" heading or the like. Right now it takes no parameter other than {{para|1|{{var|foo}}}}, to change the <code><nowiki>{{{1}}}</nowiki></code> to something else, thus changing the display (and operation) to use something other than {{para|1}} in the shown template operations.
{{Documentation|content=This is transcluded documentation, which can be transcluded in the /doc pages of various templates like {{tlx|Block indent}} and {{tlx|Quote}}, e.g. under a "Technical issue with block templates" heading or the like. Right now it takes no parameter other than {{para|1|{{var|foo}}}}, to change the <code><nowiki>{{{1}}}</nowiki></code> to something else, thus changing the display (and operation) to use something other than {{para|1}} in the shown template operations.


[[Category:Template documentation]]
[[Category:Documentation shared content templates]]
}}
}}
{{En-WP attribution notice|Template:Block bug documentation}}
</noinclude>
</noinclude>

Latest revision as of 19:48, 31 May 2021

Template:Notice

If the block-formatted content begins with a list (or any other wikimarkup that is dependent upon a specific markup character being at the beginning of a line) then due to a bug in MediaWiki, a <nowiki /> must exist before the list (or whatever) starts. Compare:

  code result
FAIL
 {{Block bug documentation|1=
 *Firstly, ...
 *Secondly, ...
 *Thirdly, ...
 }}
Template:Error
Works as intended
 {{Block bug documentation|1=<nowiki />
 *Firstly, ...
 *Secondly, ...
 *Thirdly, ...
 }}
Template:Error

To embed a table in block markup like this, the block template's content parameter must be named or numbered and include the self-closing noinclude – as in |1=<nowiki /> – then every | character in the table markup must be escaped with {{!}}. An alternative is to use explicit HTML <table>, <tr>, <th>, and <td> markup.