Template:Block bug documentation

From Wayne's Dusty Box of Words
Revision as of 10:55, 8 February 2022 by Wprecht (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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 {{#switch:s

|c|close  = 
|s|single
|o|open
|p|pair   = <{{#switch:nowiki
|categorytree=categorytree
|charinsert=charinsert
|ce=ce
|chem=chem
|gallery=gallery
|graph=graph
|hiero=hiero
|includeonly=includeonly
|indicator=indicator
|imagemap=imagemap
|inputbox=inputbox
|mapframe=mapframe
|maplink=maplink
|math=math
|math chem=math chem
|noinclude=noinclude
|nowiki=nowiki
|onlyinclude=onlyinclude
|poem=poem
|pre=pre
|ref=ref
|references=references
|score=score
|section=section
|source=source
|syntaxhighlight=syntaxhighlight
|templatedata=templatedata
|templatestyles=templatestyles
|timeline=timeline
|#default=nowiki

}}{{#if:| {{{params}}}}} }}{{#switch:s

|c|close  = 
|s|single =   />
|o|open   = >
|p|pair   = >...

}}{{#switch:s

|s|single
|o|open   = 
|c|close
|p|pair   = </nowiki>

}} and a new line must exist before the list (or whatever) starts. Compare:

  code result
FAIL
 {{ Block bug documentation|1=
 *Firstly, ...
 *Secondly, ...
 *Thirdly, ...
 }}
Script error: No such module "Error".
Works as intended
 {{ Block bug documentation|1=<nowiki />
*Firstly, ... *Secondly, ... *Thirdly, ... }}
Script error: No such module "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 {{[[{{#if:|{{{SISTER}}}Template|Template}}:!|!]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}}. An alternative is to use explicit HTML <syntaxhighlight lang="html" class="" id="" style="" inline="1">

</syntaxhighlight>, <syntaxhighlight lang="html" class="" id="" style="" inline="1"></syntaxhighlight>, <syntaxhighlight lang="html" class="" id="" style="" inline="1">
</syntaxhighlight>, and <syntaxhighlight lang="html" class="" id="" style="" inline="1"></syntaxhighlight> markup. {{#if:This is transcluded documentation, which can be transcluded in the /doc pages of various templates like {{[[{{#if:|{{{SISTER}}}Template|Template}}:Block indent|Block indent]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}} and {{[[{{#if:|{{{SISTER}}}Template|Template}}:Quote|Quote]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}}, e.g. under a "Technical issue with block templates" heading or the like. Right now it takes no parameter other than |{{SAFESUBST:#if:1|1=}}foo, to change the {{{1}}} to something else, thus changing the display (and operation) to use something other than |{{SAFESUBST:#if:1|1=}} in the shown template operations.|

[[Category:Template documentation pages{{#translation:}}]] }}