Template:Explanation: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
(Created page with "<includeonly>{| class="wikitable mw-collapsible mw-collapsed" ! {{{title|{{{1|Explanation}}}}}} |- | {{{contents}}} |}</includeonly> <noinclude> == Usage == {| class="wikitable" ! Wikitext !! Result |- |<pre>{{Explanation|contents=The result is 2+255=257, which overflows and becomes 1.}}</pre> | {{Explanation|contents=The result is 2+255=257, which overflows and becomes 1.}} |- |<pre>{{Explanation |title=Alternative title |contents=You can use <code>title=</code> to set...") |
m (Removed a superfluous newline character not surrounded by the <noinclude> tags.) |
||
Line 4: | Line 4: | ||
| |
| |
||
{{{contents}}} |
{{{contents}}} |
||
|}</includeonly> |
|}</includeonly><noinclude> |
||
<noinclude> |
|||
== Usage == |
== Usage == |
||
{| class="wikitable" |
{| class="wikitable" |
||
Line 20: | Line 19: | ||
|title=Alternative title |
|title=Alternative title |
||
|contents=You can use <code>title=</code> to set an alternative title... |
|contents=You can use <code>title=</code> to set an alternative title... |
||
}} |
}} |
||
|- |
|||
|<pre>{{Explanation |
|<pre>{{Explanation |
||
|Alternative title |
|Alternative title |
Latest revision as of 07:31, 2 January 2023
Usage
Wikitext | Result | ||
---|---|---|---|
{{Explanation|contents=The result is 2+255=257, which overflows and becomes 1.}} |
| ||
{{Explanation |title=Alternative title |contents=You can use <code>title=</code> to set an alternative title... }} |
| ||
{{Explanation |Alternative title |contents=... or just use an unnamed parameter. }} |
|
For now, the contents cannot be an unnamed parameter, because:
- Handling the logic of unnamed parameters in wikitext can be quite hairy (especially because when there is only one unnamed parameter it should be the contents, but when there are two unnamed parameters most people would expect the title to come first).
- The contents is likely to have a "=" character, which would break the unnamed parameter anyway. Furthermore, this issue can catch unwitting editors by surprise and can be quite difficult to debug.