From de8fd9328e9deb0d1ec596d7486686ea3cb688c2 Mon Sep 17 00:00:00 2001 From: "Felix (xq) Queißner" Date: Tue, 9 Jun 2020 18:27:38 +0200 Subject: Includes cmark markdown parser library. --- lib/cmark/test/smart_punct.txt | 177 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 177 insertions(+) create mode 100644 lib/cmark/test/smart_punct.txt (limited to 'lib/cmark/test/smart_punct.txt') diff --git a/lib/cmark/test/smart_punct.txt b/lib/cmark/test/smart_punct.txt new file mode 100644 index 0000000..fd55e62 --- /dev/null +++ b/lib/cmark/test/smart_punct.txt @@ -0,0 +1,177 @@ +## 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: + +```````````````````````````````` example +"Hello," said the spider. +"'Shelob' is my name." +. +

“Hello,” said the spider. +“‘Shelob’ is my name.”

+```````````````````````````````` + +```````````````````````````````` example +'A', 'B', and 'C' are letters. +. +

‘A’, ‘B’, and ‘C’ are letters.

+```````````````````````````````` + +```````````````````````````````` example +'Oak,' 'elm,' and 'beech' are names of trees. +So is 'pine.' +. +

‘Oak,’ ‘elm,’ and ‘beech’ are names of trees. +So is ‘pine.’

+```````````````````````````````` + +```````````````````````````````` example +'He said, "I want to go."' +. +

‘He said, “I want to go.”’

+```````````````````````````````` + +A single quote that isn't an open quote matched +with a close quote will be treated as an +apostrophe: + +```````````````````````````````` example +Were you alive in the 70's? +. +

Were you alive in the 70’s?

+```````````````````````````````` + +```````````````````````````````` example +Here is some quoted '`code`' and a "[quoted link](url)". +. +

Here is some quoted ‘code’ and a “quoted link”.

+```````````````````````````````` + +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`: + +```````````````````````````````` example +'tis the season to be 'jolly' +. +

’tis the season to be ‘jolly’

+```````````````````````````````` + +Multiple apostrophes should not be marked as open/closing quotes. + +```````````````````````````````` example +'We'll use Jane's boat and John's truck,' Jenna said. +. +

‘We’ll use Jane’s boat and John’s truck,’ Jenna said.

+```````````````````````````````` + +An unmatched double quote will be interpreted as a +left double quote, to facilitate this style: + +```````````````````````````````` example +"A paragraph with no closing quote. + +"Second paragraph by same speaker, in fiction." +. +

“A paragraph with no closing quote.

+

“Second paragraph by same speaker, in fiction.”

+```````````````````````````````` + +A quote following a `]` or `)` character cannot +be an open quote: + +```````````````````````````````` example +[a]'s b' +. +

[a]’s b’

+```````````````````````````````` + +Quotes that are escaped come out as literal straight +quotes: + +```````````````````````````````` example +\"This is not smart.\" +This isn\'t either. +5\'8\" +. +

"This is not smart." +This isn't either. +5'8"

+```````````````````````````````` + +Two hyphens form an en-dash, three an em-dash. + +```````````````````````````````` example +Some dashes: em---em +en--en +em --- em +en -- en +2--3 +. +

Some dashes: em—em +en–en +em — em +en – en +2–3

+```````````````````````````````` + +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). + +```````````````````````````````` example +one- +two-- +three--- +four---- +five----- +six------ +seven------- +eight-------- +nine--------- +thirteen-------------. +. +

one- +two– +three— +four–– +five—– +six—— +seven—–– +eight–––– +nine——— +thirteen———––.

+```````````````````````````````` + +Hyphens can be escaped: + +```````````````````````````````` example +Escaped hyphens: \-- \-\-\-. +. +

Escaped hyphens: -- ---.

+```````````````````````````````` + +Three periods form an ellipsis: + +```````````````````````````````` example +Ellipses...and...and.... +. +

Ellipses…and…and….

+```````````````````````````````` + +Periods can be escaped if ellipsis-formation +is not wanted: + +```````````````````````````````` example +No ellipses\.\.\. +. +

No ellipses...

+```````````````````````````````` -- cgit v1.2.3