Skip to content

Latest commit

 

History

History
159 lines (127 loc) · 3.45 KB

SmartyPantsSpecs.md

File metadata and controls

159 lines (127 loc) · 3.45 KB

Extensions

Adds support for smarty pants:

SmartyPants Quotes

Converts the following character to smarty pants:

This is a "text"
.
<p>This is a &ldquo;text&rdquo;</p>
This is a 'text'
.
<p>This is a &lsquo;text&rsquo;</p>
This is a <<text>>
.
<p>This is a &laquo;text&raquo;</p>

Unbalanced quotes are not changed:

This is a "text
.
<p>This is a &quot;text</p>
This is a 'text
.
<p>This is a 'text</p>
This is a <<text
.
<p>This is a &lt;&lt;text</p>

Unbalanced quotes inside other quotes are not changed:

This is a "text 'with" a another text'
.
<p>This is a &ldquo;text 'with&rdquo; a another text'</p>
This is 'a "text 'with" a another text'
.
<p>This is &lsquo;a &ldquo;text 'with&rdquo; a another text&rsquo;</p>
This is a 'text <<with' a another text>>
.
<p>This is a &lsquo;text &lt;&lt;with&rsquo; a another text&gt;&gt;</p>
This is a <<text 'with>> a another text'
.
<p>This is a &laquo;text 'with&raquo; a another text'</p>

Quotes requires to have the same rules than emphasis _ regarding left/right frankling rules:

It's not quotes'
.
<p>It's not quotes'</p>
They are ' not matching quotes '
.
<p>They are ' not matching quotes '</p>
They are' not matching 'quotes
.
<p>They are' not matching 'quotes</p>

An emphasis starting inside left/right quotes will span over the right quote:

This is "a *text" with an emphasis*
.
<p>This is &ldquo;a <em>text&rdquo; with an emphasis</em></p>

Multiple sets of quotes can be used

"aaa" "bbb" "ccc" "ddd"
.
<p>&ldquo;aaa&rdquo; &ldquo;bbb&rdquo; &ldquo;ccc&rdquo; &ldquo;ddd&rdquo;</p>

SmartyPants Separators

This is a -- text
.
<p>This is a &ndash; text</p>
This is a --- text
.
<p>This is a &mdash; text</p>
This is a en ellipsis...
.
<p>This is a en ellipsis&hellip;</p>

Check that a smartypants are not breaking pipetable parsing:

a  | b
-- | --
0  | 1
.
<table>
<thead>
<tr>
<th>a</th>
<th>b</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td>1</td>
</tr>
</tbody>
</table>

Check quotes and dash:

A "quote" with a ---
.
<p>A &ldquo;quote&rdquo; with a &mdash;</p>