|
|
|
Should parse nested quotes:
|
|
|
|
|
|
|
|
.
|
|
|
|
"foo 'bar' baz"
|
|
|
|
.
|
|
|
|
<p>“foo ‘bar’ baz”</p>
|
|
|
|
.
|
|
|
|
|
|
|
|
.
|
|
|
|
'foo 'bar' baz'
|
|
|
|
.
|
|
|
|
<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 not match quotes on different levels:
|
|
|
|
|
|
|
|
.
|
|
|
|
*"foo* bar"
|
|
|
|
|
|
|
|
"foo *bar"*
|
|
|
|
.
|
|
|
|
<p><em>"foo</em> bar"</p>
|
|
|
|
<p>"foo <em>bar"</em></p>
|
|
|
|
.
|
|
|
|
|
|
|
|
.
|
|
|
|
*"foo* bar *baz"*
|
|
|
|
.
|
|
|
|
<p><em>"foo</em> bar <em>baz"</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""
|
|
|
|
.
|
|
|
|
<p>“Monitor 21"”</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>
|
|
|
|
.
|