blob: 70378b8e3b2611881959d3d9a0253eb416d82524 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
|
Should parse nested quotes:
.
"foo 'bar' baz"
'foo 'bar' baz'
.
<p>“foo ‘bar’ baz”</p>
<p>‘foo ‘bar’ baz’</p>
.
Should not overlap quotes:
.
'foo "bar' baz"
.
<p>‘foo "bar’ baz"</p>
.
Should match quotes on the same level:
.
"foo *bar* baz"
.
<p>“foo <em>bar</em> baz”</p>
.
Should handle adjacent nested quotes:
.
'"double in single"'
"'single in double'"
.
<p>‘“double in single”’</p>
<p>“‘single in double’”</p>
.
Should not match quotes on different levels:
.
*"foo* bar"
"foo *bar"*
*"foo* bar *baz"*
.
<p><em>"foo</em> bar"</p>
<p>"foo <em>bar"</em></p>
<p><em>"foo</em> bar <em>baz"</em></p>
.
Smartquotes should not overlap with other tags:
.
*foo "bar* *baz" quux*
.
<p><em>foo "bar</em> <em>baz" quux</em></p>
.
Should try and find matching quote in this case:
.
"foo "bar 'baz"
.
<p>"foo “bar 'baz”</p>
.
Should not touch 'inches' in quotes:
.
"Monitor 21"" and "Monitor""
.
<p>“Monitor 21"” and “Monitor”"</p>
.
Should render an apostrophe as a rsquo:
.
This isn't and can't be the best approach to implement this...
.
<p>This isn’t and can’t be the best approach to implement this…</p>
.
Apostrophe could end the word, that's why original smartypants replaces all of them as rsquo:
.
users' stuff
.
<p>users’ stuff</p>
.
Quotes between punctuation chars:
.
"(hai)".
.
<p>“(hai)”.</p>
.
Quotes at the start/end of the tokens:
.
"*foo* bar"
"foo *bar*"
"*foo bar*"
.
<p>“<em>foo</em> bar”</p>
<p>“foo <em>bar</em>”</p>
<p>“<em>foo bar</em>”</p>
.
Should treat softbreak as a space:
.
"this"
and "that".
"this" and
"that".
.
<p>“this”
and “that”.</p>
<p>“this” and
“that”.</p>
.
Should treat hardbreak as a space:
.
"this"\
and "that".
"this" and\
"that".
.
<p>“this”<br />
and “that”.</p>
<p>“this” and<br />
“that”.</p>
.
Should allow quotes adjacent to other punctuation characters, #643:
.
The dog---"'man's' best friend"
.
<p>The dog—“‘man’s’ best friend”</p>
.
Should parse quotes adjacent to code block, #677:
.
"test `code`"
"`code` test"
.
<p>“test <code>code</code>”</p>
<p>“<code>code</code> test”</p>
.
Should parse quotes adjacent to inline html, #677:
.
"test <br>"
"<br> test"
.
<p>“test <br>”</p>
<p>“<br> test”</p>
.
|