From 12e8343068b906f8b2afddc5569968a8a91fa5b0 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 29 Apr 2024 06:24:24 +0200 Subject: Adding upstream version 2.1.0. Signed-off-by: Daniel Baumann --- tests/test_port/fixtures/smartquotes.md | 166 ++++++++++++++++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 tests/test_port/fixtures/smartquotes.md (limited to 'tests/test_port/fixtures/smartquotes.md') diff --git a/tests/test_port/fixtures/smartquotes.md b/tests/test_port/fixtures/smartquotes.md new file mode 100644 index 0000000..70378b8 --- /dev/null +++ b/tests/test_port/fixtures/smartquotes.md @@ -0,0 +1,166 @@ +Should parse nested quotes: +. +"foo 'bar' baz" + +'foo 'bar' baz' +. +

“foo ‘bar’ baz”

+

‘foo ‘bar’ baz’

+. + + +Should not overlap quotes: +. +'foo "bar' baz" +. +

‘foo "bar’ baz"

+. + + +Should match quotes on the same level: +. +"foo *bar* baz" +. +

“foo bar baz”

+. + + +Should handle adjacent nested quotes: +. +'"double in single"' + +"'single in double'" +. +

‘“double in single”’

+

“‘single in double’”

+. + + + +Should not match quotes on different levels: +. +*"foo* bar" + +"foo *bar"* + +*"foo* bar *baz"* +. +

"foo bar"

+

"foo bar"

+

"foo bar baz"

+. + +Smartquotes should not overlap with other tags: +. +*foo "bar* *baz" quux* +. +

foo "bar baz" quux

+. + + +Should try and find matching quote in this case: +. +"foo "bar 'baz" +. +

"foo “bar 'baz”

+. + + +Should not touch 'inches' in quotes: +. +"Monitor 21"" and "Monitor"" +. +

“Monitor 21"” and “Monitor”"

+. + + +Should render an apostrophe as a rsquo: +. +This isn't and can't be the best approach to implement this... +. +

This isn’t and can’t be the best approach to implement this…

+. + + +Apostrophe could end the word, that's why original smartypants replaces all of them as rsquo: +. +users' stuff +. +

users’ stuff

+. + +Quotes between punctuation chars: + +. +"(hai)". +. +

“(hai)”.

+. + +Quotes at the start/end of the tokens: +. +"*foo* bar" + +"foo *bar*" + +"*foo bar*" +. +

foo bar”

+

“foo bar

+

foo bar

+. + +Should treat softbreak as a space: +. +"this" +and "that". + +"this" and +"that". +. +

“this” +and “that”.

+

“this” and +“that”.

+. + +Should treat hardbreak as a space: +. +"this"\ +and "that". + +"this" and\ +"that". +. +

“this”
+and “that”.

+

“this” and
+“that”.

+. + +Should allow quotes adjacent to other punctuation characters, #643: +. +The dog---"'man's' best friend" +. +

The dog—“‘man’s’ best friend”

+. + +Should parse quotes adjacent to code block, #677: +. +"test `code`" + +"`code` test" +. +

“test code

+

code test”

+. + +Should parse quotes adjacent to inline html, #677: +. +"test
" + +"
test" +. +

“test

+


test”

+. \ No newline at end of file -- cgit v1.2.3