From ef4482ce4b084aa97155dbde89f02dda3f7fb219 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Wed, 28 Aug 2024 10:21:21 +0200 Subject: Better smartquotes (#4849) --- tests/ref/smartquote-bracket.png | Bin 0 -> 563 bytes tests/ref/smartquote-close-before-letter.png | Bin 0 -> 614 bytes tests/ref/smartquote-escape.png | Bin 1307 -> 1306 bytes tests/ref/smartquote-prime.png | Bin 0 -> 742 bytes tests/ref/smartquote-slash.png | Bin 0 -> 1243 bytes tests/suite/text/smartquote.typ | 23 ++++++++++++++++++++++- 6 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 tests/ref/smartquote-bracket.png create mode 100644 tests/ref/smartquote-close-before-letter.png create mode 100644 tests/ref/smartquote-prime.png create mode 100644 tests/ref/smartquote-slash.png (limited to 'tests') diff --git a/tests/ref/smartquote-bracket.png b/tests/ref/smartquote-bracket.png new file mode 100644 index 00000000..7efcccf8 Binary files /dev/null and b/tests/ref/smartquote-bracket.png differ diff --git a/tests/ref/smartquote-close-before-letter.png b/tests/ref/smartquote-close-before-letter.png new file mode 100644 index 00000000..8061c12a Binary files /dev/null and b/tests/ref/smartquote-close-before-letter.png differ diff --git a/tests/ref/smartquote-escape.png b/tests/ref/smartquote-escape.png index 45d8f602..ea4aef9c 100644 Binary files a/tests/ref/smartquote-escape.png and b/tests/ref/smartquote-escape.png differ diff --git a/tests/ref/smartquote-prime.png b/tests/ref/smartquote-prime.png new file mode 100644 index 00000000..35c37612 Binary files /dev/null and b/tests/ref/smartquote-prime.png differ diff --git a/tests/ref/smartquote-slash.png b/tests/ref/smartquote-slash.png new file mode 100644 index 00000000..925f28e6 Binary files /dev/null and b/tests/ref/smartquote-slash.png differ diff --git a/tests/suite/text/smartquote.typ b/tests/suite/text/smartquote.typ index 4c27be07..a69ad25c 100644 --- a/tests/suite/text/smartquote.typ +++ b/tests/suite/text/smartquote.typ @@ -56,7 +56,28 @@ He said "I'm a big fella." --- smartquote-escape --- // Test escape sequences. -The 5\'11\" 'quick\' brown fox jumps over the \"lazy" dog\'s ear. +The 5\'11\" 'quick\' brown fox jumps over the \"lazy' dog\'s ear. + +--- smartquote-slash --- +// Test that smartquotes can open before non-whitespace if not nested. +"Hello"/"World" \ +'"Hello"/"World"' \ +""Hello"/"World"" + +--- smartquote-close-before-letter --- +// Test that smartquotes can close before alphabetic letters. +Straight "A"s and "B"s + +--- smartquote-prime --- +// Test that primes result after numbers when possible. +A 2" nail. \ +'A 2" nail.' \ +"A 2" nail." + +--- smartquote-bracket --- +// Test that brackets indicate an opening quote. +"a ["b"] c" \ +"a b"c"d e" --- smartquote-disable --- // Test turning smart quotes off. -- cgit v1.2.3