size: 3 KiB

1Open quotes are matched with closed quotes.
2The same method is used for matching openers and closers
3as is used in emphasis parsing:
4
5```
6"Hello," said the spider.
7"'Shelob' is my name."
8.
9<p>&ldquo;Hello,&rdquo; said the spider.
10&ldquo;&lsquo;Shelob&rsquo; is my name.&rdquo;</p>
11```
12
13```
14'A', 'B', and 'C' are letters.
15.
16<p>&lsquo;A&rsquo;, &lsquo;B&rsquo;, and &lsquo;C&rsquo; are letters.</p>
17```
18
19```
20'Oak,' 'elm,' and 'beech' are names of trees.
21So is 'pine.'
22.
23<p>&lsquo;Oak,&rsquo; &lsquo;elm,&rsquo; and &lsquo;beech&rsquo; are names of trees.
24So is &lsquo;pine.&rsquo;</p>
25```
26
27```
28'He said, "I want to go."'
29.
30<p>&lsquo;He said, &ldquo;I want to go.&rdquo;&rsquo;</p>
31```
32
33A single quote that isn't an open quote matched
34with a close quote will be treated as an
35apostrophe:
36
37```
38Were you alive in the '70s?
39.
40<p>Were you alive in the &rsquo;70s?</p>
41```
42
43```
44Here is some quoted '`code`' and a "[quoted link](url)".
45.
46<p>Here is some quoted &lsquo;<code>code</code>&rsquo; and a &ldquo;<a href="url">quoted link</a>&rdquo;.</p>
47```
48
49Here the first `'` is treated as an apostrophe, not
50an open quote, because the final single quote is matched
51by the single quote before `jolly`:
52
53```
54'tis the season to be 'jolly'
55.
56<p>&rsquo;tis the season to be &lsquo;jolly&rsquo;</p>
57```
58
59Multiple apostrophes should not be marked as open/closing quotes.
60
61```
62'We'll use Jane's boat and John's truck,' Jenna said.
63.
64<p>&lsquo;We&rsquo;ll use Jane&rsquo;s boat and John&rsquo;s truck,&rsquo; Jenna said.</p>
65```
66
67An unmatched double quote will be interpreted as a
68left double quote, to facilitate this style:
69
70```
71"A paragraph with no closing quote.
72
73"Second paragraph by same speaker, in fiction."
74.
75<p>&ldquo;A paragraph with no closing quote.</p>
76<p>&ldquo;Second paragraph by same speaker, in fiction.&rdquo;</p>
77```
78
79A quote following a `]` or `)` character cannot
80be an open quote:
81
82```
83[a]'s b'
84.
85<p>[a]&rsquo;s b&rsquo;</p>
86```
87
88Quotes that are escaped come out as literal straight
89quotes:
90
91```
92\"This is not smart.\"
93This isn\'t either.
945\'8\"
95.
96<p>"This is not smart."
97This isn't either.
985'8"</p>
99```
100
101Doubled quotes are treated as nested:
102
103```
104''hi''
105.
106<p>&lsquo;&lsquo;hi&rsquo;&rsquo;</p>
107```
108
109Heuristics for determining openers and closers can
110be overridden using `{` and `}`:
111
112```
113{''}hi{''}
114.
115<p>&lsquo;&rsquo;hi&lsquo;&rsquo;</p>
116```
117
118Two hyphens form an en-dash, three an em-dash.
119
120```
121Some dashes: em---em
122en--en
123em --- em
124en -- en
1252--3
126.
127<p>Some dashes: em&mdash;em
128en&ndash;en
129em &mdash; em
130en &ndash; en
1312&ndash;3</p>
132```
133
134A sequence of more than three hyphens is
135parsed as a sequence of em and/or en dashes,
136with no hyphens. If possible, a homogeneous
137sequence of dashes is used (so, 10 hyphens
138= 5 en dashes, and 9 hyphens = 3 em dashes).
139When a heterogeneous sequence must be used,
140the em dashes come first, followed by the en
141dashes, and as few en dashes as possible are
142used (so, 7 hyphens = 2 em dashes an 1 en
143dash).
144
145```
146one-
147two--
148three---
149four----
150five-----
151six------
152seven-------
153eight--------
154nine---------
155thirteen-------------.
156.
157<p>one-
158two&ndash;
159three&mdash;
160four&ndash;&ndash;
161five&mdash;&ndash;
162six&mdash;&mdash;
163seven&mdash;&ndash;&ndash;
164eight&ndash;&ndash;&ndash;&ndash;
165nine&mdash;&mdash;&mdash;
166thirteen&mdash;&mdash;&mdash;&ndash;&ndash;.</p>
167```
168
169Hyphens can be escaped:
170
171```
172Escaped hyphens: \-- \-\-\-.
173.
174<p>Escaped hyphens: -- ---.</p>
175```
176
177Three periods form an ellipsis:
178
179```
180Ellipses...and...and....
181.
182<p>Ellipses&hellip;and&hellip;and&hellip;.</p>
183```
184
185Periods can be escaped if ellipsis-formation
186is not wanted:
187
188```
189No ellipses\.\.\.
190.
191<p>No ellipses...</p>
192```