Content deleted Content added
Created page with ' — <noinclude> {{documentation}} <!-- Add categories and interwikis to the /doc subpage, not here! --> </noinclude>'
 
No edit summary
ފޮޅުވަތް 1:
{{Documentation subpage}}
&nbsp;&mdash; <noinclude>
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
__NOTOC__
{{caution
| Due to the [[WP:DASH|discouragement]] of spaced em dashes by the [[Wikipedia:Manual of Style|Wikipedia Manual of Style]], the usage of this template in articles should generally be avoided. There can be exceptions for some horizontal lists and navigation boxes, but even there the appropriateness of spaced em dashes is under dispute. For horizontal lists consider using {{tn|·}} or {{tl|ndash}} instead. For vertical lists simply use an en dash "<code>–</code>" directly. The en dash is the first item in the "Insert" section below the Wikipedia edit window.
}}
 
This is the '''mdash''' template, it looks like this " &mdash; ".
{{documentation}}
 
<!-- Add categories and interwikis to the /doc subpage, not here! -->
It works similarly to the html markup sequence "<code>'''&amp;nbsp;&amp;mdash;'''&nbsp;</code>". That is, a [[non-breaking space]], a long dash (known as an [[Dash#Em dash|em dash]]) and a normal space.
</noinclude>
 
{{tl|—}} and {{tl|emdash}} redirect here and can be used as alternative names for this template.
 
This template is used when you want something a lot stronger than a [[Template:·|bold middot]] "'''&middot;'''", a [[Template:•|bullet]] "&bull;" or a [[Template:Ndash|ndash]] "&ndash;".
 
=== Normal usage ===
 
The recommended usage is to use ''no'' space before the template and one space after the template, like this:
<nowiki>[[Salt]]{{mdash}} [[Pepper]]</nowiki>
 
It will render one space on each side of the dash, like this:
:[[Salt]] &mdash; [[Black pepper|Pepper]]
 
If it line breaks then the line break will come ''after'' the dash, not before, like this:
:[[Salt]] &mdash;
:[[Black pepper|Pepper]]
 
For long dashed lists each list item can be put on its own line, with no spaces between each item and the template. Like this:
<pre><nowiki>
[[Salt]]{{mdash}}
[[Pepper]]{{mdash}}
[[Curry]]{{mdash}}
[[Saffron]]</nowiki></pre>
 
(It doesn't matter if there are no or some spaces at the end of the lines, after the templates.)
 
As before it will render one space on each side of the dashes, like this:
:[[Salt]] &mdash; [[Black pepper|Pepper]] &mdash; [[Curry]] &mdash; [[Saffron]]
 
And if it line breaks then the line break will come ''after'' one of the dashes, not before, like this:
:[[Salt]] &mdash; [[Black pepper|Pepper]] &mdash;
:[[Curry]] &mdash; [[Saffron]]
 
But really, you should use [[Template:·|bold middots]] "'''&middot;'''" or [[Template:Ndash|ndashes]] "&ndash;" for such lists.
 
=== Incorrect usage ===
 
If the template is used slightly wrong it will in some cases still behave well. For instance if there are no or several spaces after the template. Like these examples:
 
<nowiki>[[Salt]]{{mdash}}[[Pepper]]</nowiki>
<nowiki>[[Salt]]{{mdash}} [[Pepper]]</nowiki>
 
Both of them will render exactly as before, with just one space on each side of the dash, like this:
:[[Salt]] &mdash; [[Black pepper|Pepper]]
 
And it will still only line break ''after'' the dash, like this:
:[[Salt]] &mdash;
:[[Black pepper|Pepper]]
 
But putting one or more spaces before the template will cause problems, like these examples:
<nowiki>[[Salt]] {{mdash}}[[Pepper]]</nowiki>
<nowiki>[[Salt]] {{mdash}}[[Pepper]]</nowiki>
<nowiki>[[Salt]] {{mdash}} [[Pepper]]</nowiki>
<nowiki>[[Salt]] {{mdash}} [[Pepper]]</nowiki>
 
Then it will render with ''two'' spaces before the dash, and one after, like this:
:[[Salt]] &nbsp;&mdash; [[Black pepper|Pepper]]
 
And if it line breaks it might break ''before'' the dash, like this:
:[[Salt]]
:&nbsp;&mdash; [[Black pepper|Pepper]]
 
Because tool-tip previews in Wikipedia do not render template contents, avoid using this template in the first 500 characters, or so, of the lead section text, exclusive of wikilinks and hypertext formatting characters. Instead, use <nowiki>"&amp;nbsp;&amp;mdash; "</nowiki> or <nowiki>"&amp;nbsp;— "</nowiki>.
 
=== Technical details ===
 
The space before the dash is a [[non-breaking space]]. That means it will not line break and will not collapse together with normal spaces that come before the template.
 
The space after the dash is a normal space. That means it wraps (allows line breaks) and it will collapse together with normal spaces that come after the template to form one single space.
 
=== Dot size reference list ===
 
{| style="text-align:center; background:transparent;"
| style="width:1.7em;" | <small>&middot;</small>
| align="left" | &lt;small> middot
|-
| &middot;
| align="left" | middot
|-
| <small>'''&middot;'''</small>
| align="left" | &lt;small> bold middot
|-
| '''&middot;'''
| align="left" | bold middot
|-
| <small>&bull;</small>
| align="left" | &lt;small> bullet
|-
| &bull;
| align="left" | bullet
|-
| '''&bull;'''
| align="left" | bold bullet
|-
| &ndash;
| align="left" | ndash
|-
| &mdash;
| align="left" | mdash
|}
 
=== See also ===
 
There are several other templates with similar functionality:
 
* {{tn|·}} – Bold middot "'''&middot;'''" is mostly used for dotted lists.
* {{tn|•}} – Bullet "&bull;" is mostly used for dotted lists that use small font sizes.
* {{tl|ndash}} – Ndash "&ndash;" is a short dash, one half the width of an [[Dash#Em dash|em dash]].
 
<includeonly>
<!-- ADD CATEGORIES BELOW THIS LINE -->
[[Category:Wikipedia formatting and function templates|{{PAGENAME}}]]
 
<!-- ADD INTERWIKIS BELOW THIS LINE -->
[[ja:Template:Mdash]]
[[pt:Predefinição:Mdash]]
</includeonly>