This is the template test cases page for the sandbox of Template:Dfn. to update the examples. If there are many examples of a complicated template, later ones may break due to limits in MediaWiki; see the HTML comment "NewPP limit report" in the rendered page. You can also use Special:ExpandTemplates to examine the results of template uses. You can test how this page looks in the different skins and parsers with these links: |
Normalized basic testcases
edit{{Dfn|term|definition}}
→ term{{Dfn/sandbox|term|definition}}
→ term
{{Dfn|term|2=definition-2}}
→ term{{Dfn/sandbox|term|2=definition-2}}
→ term
{{Dfn|1=term-1|2=definition-2}}
→ term-1{{Dfn/sandbox|1=term-1|2=definition-2}}
→ term-1
{{Dfn|2=definition-2r|1=term-1r}}
→ term-1r{{Dfn/sandbox|2=definition-2r|1=term-1r}}
→ term-1r
{{Dfn|2=definition-2r|term-r}}
→ term-r{{Dfn/sandbox|2=definition-2r|term-r}}
→ term-r
{{Dfn|term|definition|title=title}}
→ term{{Dfn/sandbox|term|definition|title=title}}
→ term
{{Dfn|term|2=definition-2|title=title}}
→ term{{Dfn/sandbox|term|2=definition-2|title=title}}
→ term
{{Dfn|1=term-1|2=definition-2|title=title}}
→ term-1{{Dfn/sandbox|1=term-1|2=definition-2|title=title}}
→ term-1
{{Dfn|2=definition-2r|1=term-1r|title=title}}
→ term-1r{{Dfn/sandbox|2=definition-2r|1=term-1r|title=title}}
→ term-1r
{{Dfn|2=definition-2r|term-r|title=title}}
→ term-r{{Dfn/sandbox|2=definition-2r|term-r|title=title}}
→ term-r
{{Dfn|title=title|term|definition}}
→ term{{Dfn/sandbox|title=title|term|definition}}
→ term
{{Dfn|title=title|term|2=definition-2}}
→ term{{Dfn/sandbox|title=title|term|2=definition-2}}
→ term
{{Dfn|title=title|1=term-1|2=definition-2}}
→ term-1{{Dfn/sandbox|title=title|1=term-1|2=definition-2}}
→ term-1
{{Dfn|title=title|2=definition-2r|1=term-1r}}
→ term-1r{{Dfn/sandbox|title=title|2=definition-2r|1=term-1r}}
→ term-1r
{{Dfn|title=title|2=definition-2r|term-r}}
→ term-r{{Dfn/sandbox|title=title|2=definition-2r|term-r}}
→ term-r
{{Dfn|title=title|term}}
→ term{{Dfn/sandbox|title=title|term}}
→ term
{{Dfnn|title=title|1=term-1}}
→ term-1{{Dfn/sandboxn|title=title|1=term-1}}
→ term-1
{{Dfn|term|title=title}}
→ term{{Dfn/sandbox|term|title=title}}
→ term
{{Dfn|1=term-1|title=title}}
→ term-1{{Dfn/sandbox|1=term-1|title=title}}
→ term-1
Some wording from the docs with test cases
editIf there would be a "=
" (equals sign) in the term, either a) both unnamed parameters if present must explicitly be numbered:
- Live:
{{dfn|1=E=MC2|2=Mass–energy equivalence}}
which results in: E=MC2 - Sandbox:
{{dfn|1=E=MC2|2=Mass–energy equivalence}}
which results in: E=MC2
or b) the character itself can be escaped as the HTML character entity reference code =
or the {{=}}
template:
Live:
{{dfn|E=MC2|Mass–energy equivalence}}
which results in: E=MC2{{dfn|E{{=}}MC2|Mass–energy equivalence|title=E=MC²}}
which results in: E=MC2
Sandbox:
{{dfn|E=MC2|Mass–energy equivalence}}
which results in: E=MC2{{dfn|E{{=}}MC2|Mass–energy equivalence|title=E=MC²}}
which results in: E=MC2
For technical reasons, the second parameter (|2=
, the definition) is more "brittle". The equals sign (=
) must be escaped by one of the techniques just mentioned, and the standard keyboard (straight, not curly) double-quotation mark ("
) must also be escaped, no matter what, as "
or "
. This double-quote must also be escaped the same way in the |title=
parameter:
Live:
{{dfn|1=ACT UP's slogan|2="Silence = Death"}}
which results in: ACT UP's slogan{{dfn|ACT UP's slogan|"Silence {{=}} Death"}}
which results in: ACT UP's slogan{{dfn|ACT UP's slogan|"Silence = Death"}}
which results in: ACT UP's slogan{{dfn|"Teenage Wasteland"{{sic}}|title="Baba O'Riley"}}
which results in: "Teenage Wasteland" [sic]{{dfn|Mac OS X Lion|title=Mac OS X 10.7 "Lion"}}
results in: Mac OS X Lion
Sandbox:
{{dfn|1=ACT UP's slogan|2="Silence = Death"}}
which results in: ACT UP's slogan{{dfn|ACT UP's slogan|"Silence {{=}} Death"}}
which results in: ACT UP's slogan{{dfn|ACT UP's slogan|"Silence = Death"}}
which results in: ACT UP's slogan{{dfn|"Teenage Wasteland"{{sic}}|title="Baba O'Riley"}}
which results in: "Teenage Wasteland" [sic]{{dfn|Mac OS X Lion|title=Mac OS X 10.7 "Lion"}}
results in: Mac OS X Lion
...
Linked version:
Live:
[[Mass–energy equivalence|
{{dfn|1=E=MC2|2=Mass–energy equivalence; E is energy, m is mass, and c is the speed of light in a vacuum|title=E=MC²}}
]]
gives:
Sandbox:
[[Mass–energy equivalence|
{{dfn/sandbox|1=E=MC2|2=Mass–energy equivalence; E is energy, m is mass, and c is the speed of light in a vacuum|title=E=MC²}}
]]
gives:
It still has a dotted underline indicating a tooltip, but is also a bluelink. Mouse hovering shows both the tooltip and, in the status bar, the target URL, in browsers that support these features.
It still has a dotted underline indicating a tooltip, but is also a bluelink. Mouse hovering shows both the tooltip and, in the status bar, the target URL, in browsers that support these features.
Link inside the {{dfn}}
:
Live:
{{dfn|1=[[Mass–energy equivalence|E=MC2]]|2=Mass–energy equivalence; E is energy, m is mass, and c is the speed of light in a vacuum|title=E=MC²}}
results in:
Sandbox:
{{dfn/sandbox|1=[[Mass–energy equivalence|E=MC2]]|2=Mass–energy equivalence; E is energy, m is mass, and c is the speed of light in a vacuum|title=E=MC²}}
results in:
This doesn't mess up the page, but the description fails and there's no tooltip cursor, meanwhile the markup is hard for other editors to understand anyway so it is deprecated.