summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-07-09 15:57:29 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2015-07-09 15:58:52 -0700
commit46a98104de76f0bd0b88a3c06f016e2c2b08ac18 (patch)
tree4359513745aaac88c08a0851c4db141adbeb71d2 /test
parent0ac1d6a242c3bb5a43a8131c9fe8c00c977fe5ca (diff)
Updated test/smart_punct.txt.
This incorporates the changes in jgm/commonmark.js#58. Sequences of hyphens are converted to sequences of em and en dashes, with no hyphens. Currently this test fails.
Diffstat (limited to 'test')
-rw-r--r--test/smart_punct.txt84
1 files changed, 74 insertions, 10 deletions
diff --git a/test/smart_punct.txt b/test/smart_punct.txt
index 14da741..ac13a26 100644
--- a/test/smart_punct.txt
+++ b/test/smart_punct.txt
@@ -1,5 +1,9 @@
## Smart punctuation
+Open quotes are matched with closed quotes.
+The same method is used for matching openers and closers
+as is used in emphasis parsing:
+
.
"Hello," said the spider.
"'Shelob' is my name."
@@ -28,6 +32,10 @@ So is ‘pine.’</p>
<p>‘He said, “I want to go.”’</p>
.
+A single quote that isn't an open quote matched
+with a close quote will be treated as an
+apostrophe:
+
.
Were you alive in the 70's?
.
@@ -40,12 +48,19 @@ Here is some quoted '`code`' and a "[quoted link](url)".
<p>Here is some quoted ‘<code>code</code>’ and a “<a href="url">quoted link</a>”.</p>
.
+Here the first `'` is treated as an apostrophe, not
+an open quote, because the final single quote is matched
+by the single quote before `jolly`:
+
.
'tis the season to be 'jolly'
.
<p>’tis the season to be ‘jolly’</p>
.
+An unmatched double quote will be interpreted as a
+left double quote, to facilitate this style:
+
.
"A paragraph with no closing quote.
@@ -55,40 +70,89 @@ Here is some quoted '`code`' and a "[quoted link](url)".
<p>“Second paragraph by same speaker, in fiction.”</p>
.
+Quotes that are escaped come out as literal straight
+quotes:
+
.
\"This is not smart.\"
This isn\'t either.
+5\'8\"
.
<p>&quot;This is not smart.&quot;
-This isn't either.</p>
+This isn't either.
+5'8&quot;</p>
.
+Two hyphens form an en-dash, three an em-dash.
+
.
-Some dashes: one---two ---
-three---four --- five.
+Some dashes: em---em
+en--en
+em --- em
+en -- en
+2--3
.
-<p>Some dashes: one—two —
-three—four — five.</p>
+<p>Some dashes: em—em
+en–en
+em — em
+en – en
+2–3</p>
.
+A sequence of more than three hyphens is
+parsed as a sequence of em and/or en dashes,
+with no hyphens. If possible, a homogeneous
+sequence of dashes is used (so, 10 hyphens
+= 5 en dashes, and 9 hyphens = 3 em dashes).
+When a heterogeneous sequence must be used,
+the em dashes come first, followed by the en
+dashes, and as few en dashes as possible are
+used (so, 7 hyphens = 2 em dashes an 1 en
+dash).
+
.
-Escaped dashes: \-- \-\-\-.
-.
-<p>Escaped dashes: -- ---.</p>
+one-
+two--
+three---
+four----
+five-----
+six------
+seven-------
+eight--------
+nine---------
+thirteen-------------.
+.
+<p>one-
+two–
+three—
+four––
+five—–
+six——
+seven—––
+eight––––
+nine———
+thirteen———––.</p>
.
+Hyphens can be escaped:
+
.
-Dashes between numbers: 5--7, 255--66, 1987--1999.
+Escaped hyphens: \-- \-\-\-.
.
-<p>Dashes between numbers: 5–7, 255–66, 1987–1999.</p>
+<p>Escaped hyphens: -- ---.</p>
.
+Three periods form an ellipsis:
+
.
Ellipses...and...and....
.
<p>Ellipses…and…and….</p>
.
+Periods can be escaped if ellipsis-formation
+is not wanted:
+
.
No ellipses\.\.\.
.