cmark

My personal build of CMark ✏️

smart_punct.txt (4175B)

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