diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-04-13 13:07:45 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-04-13 13:08:46 +0200 |
| commit | 2279c26543f7edde910fd89a3f8f0710c67249db (patch) | |
| tree | e9dfaa89954a4e61ffe2ca7a35be251946b14ad4 /tests | |
| parent | e8dd842c6699c665225c03e904a40887f8424e30 (diff) | |
Smart quotes
Co-Authored-By: Martin Haug <mhaug@live.de>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ref/code/closure.png | bin | 801 -> 520 bytes | |||
| -rw-r--r-- | tests/ref/code/include.png | bin | 48417 -> 47947 bytes | |||
| -rw-r--r-- | tests/ref/layout/columns.png | bin | 109097 -> 122766 bytes | |||
| -rw-r--r-- | tests/ref/text/basic.png | bin | 58937 -> 58344 bytes | |||
| -rw-r--r-- | tests/ref/text/escape.png | bin | 13675 -> 13729 bytes | |||
| -rw-r--r-- | tests/ref/text/hyphenate.png | bin | 20764 -> 20776 bytes | |||
| -rw-r--r-- | tests/ref/text/justify.png | bin | 29296 -> 29352 bytes | |||
| -rw-r--r-- | tests/ref/text/quotes.png | bin | 0 -> 59067 bytes | |||
| -rw-r--r-- | tests/ref/text/tracking-spacing.png | bin | 6483 -> 6479 bytes | |||
| -rw-r--r-- | tests/typ/code/closure.typ | 7 | ||||
| -rw-r--r-- | tests/typ/text/escape.typ | 3 | ||||
| -rw-r--r-- | tests/typ/text/quotes.typ | 54 |
12 files changed, 59 insertions, 5 deletions
diff --git a/tests/ref/code/closure.png b/tests/ref/code/closure.png Binary files differindex 7d933033..b4c83256 100644 --- a/tests/ref/code/closure.png +++ b/tests/ref/code/closure.png diff --git a/tests/ref/code/include.png b/tests/ref/code/include.png Binary files differindex 2d5d9ca7..001d7d1e 100644 --- a/tests/ref/code/include.png +++ b/tests/ref/code/include.png diff --git a/tests/ref/layout/columns.png b/tests/ref/layout/columns.png Binary files differindex 8a65443d..3f471415 100644 --- a/tests/ref/layout/columns.png +++ b/tests/ref/layout/columns.png diff --git a/tests/ref/text/basic.png b/tests/ref/text/basic.png Binary files differindex e7887f07..bfdf47a2 100644 --- a/tests/ref/text/basic.png +++ b/tests/ref/text/basic.png diff --git a/tests/ref/text/escape.png b/tests/ref/text/escape.png Binary files differindex 3434d6e0..77cc21f2 100644 --- a/tests/ref/text/escape.png +++ b/tests/ref/text/escape.png diff --git a/tests/ref/text/hyphenate.png b/tests/ref/text/hyphenate.png Binary files differindex 0560d5b7..48338f58 100644 --- a/tests/ref/text/hyphenate.png +++ b/tests/ref/text/hyphenate.png diff --git a/tests/ref/text/justify.png b/tests/ref/text/justify.png Binary files differindex d0b6c7bf..396adc77 100644 --- a/tests/ref/text/justify.png +++ b/tests/ref/text/justify.png diff --git a/tests/ref/text/quotes.png b/tests/ref/text/quotes.png Binary files differnew file mode 100644 index 00000000..d31ae937 --- /dev/null +++ b/tests/ref/text/quotes.png diff --git a/tests/ref/text/tracking-spacing.png b/tests/ref/text/tracking-spacing.png Binary files differindex 8e6db3cc..69fc1eef 100644 --- a/tests/ref/text/tracking-spacing.png +++ b/tests/ref/text/tracking-spacing.png diff --git a/tests/typ/code/closure.typ b/tests/typ/code/closure.typ index 5524ba99..29fca404 100644 --- a/tests/typ/code/closure.typ +++ b/tests/typ/code/closure.typ @@ -5,11 +5,10 @@ // Don't parse closure directly in content. // Ref: true -#let x = "\"hi\"" +#let x = "x" -// Should output `"hi" => "bye"`. -#set text(overhang: false) -#x => "bye" +// Should output `x => y`. +#x => y --- // Basic closure without captures. diff --git a/tests/typ/text/escape.typ b/tests/typ/text/escape.typ index 6ec469c1..e03d73e5 100644 --- a/tests/typ/text/escape.typ +++ b/tests/typ/text/escape.typ @@ -2,7 +2,8 @@ --- // Escapable symbols. -\\ \/ \[ \] \{ \} \# \* \_ \= \~ \` \$ +\\ \/ \[ \] \{ \} \# \* \_ \ +\= \~ \` \$ \" \' // No need to escape. ( ) ; < > diff --git a/tests/typ/text/quotes.typ b/tests/typ/text/quotes.typ new file mode 100644 index 00000000..3f0649e8 --- /dev/null +++ b/tests/typ/text/quotes.typ @@ -0,0 +1,54 @@ +// Test smart quotes. + +--- +#set page(width: 200pt) + +// Test simple quotations in various languages. +#set text(lang: "en") +"The horse eats no cucumber salad" was the first sentence ever uttered on the 'telephone.' + +#set text(lang: "de") +"Das Pferd frisst keinen Gurkensalat" war der erste jemals am 'Fernsprecher' gesagte Satz. + +#set text(lang: "fr") +"Le cheval ne mange pas de salade de concombres" est la première phrase jamais prononcée au 'téléphone'. + +#set text(lang: "fi") +"Hevonen ei syö kurkkusalaattia" oli ensimmäinen koskaan 'puhelimessa' lausuttu lause. + +#set text(lang: "ro") +"Calul nu mănâncă salată de castraveți" a fost prima propoziție rostită vreodată la 'telefon'. + +#set text(lang: "ru") +"Лошадь не ест салат из огурцов" - это была первая фраза, сказанная по 'телефону'. + +--- +// Test single pair of quotes. +#set text(lang: "en") +"" + +--- +// Test sentences with numbers and apostrophes. +#set text(lang: "en") +The 5'11" 'quick' brown fox jumps over the "lazy" dog's ear. + +He said "I'm a big fella." + +--- +// Test escape sequences. +The 5\'11\" 'quick\' brown fox jumps over the \"lazy" dog\'s ear. + +--- +// Test turning smart quotes off. +#set text(lang: "en") +He's told some books contain questionable "example text". + +#set text(smart-quotes: false) +He's told some books contain questionable "example text". + +--- +// Test changing properties within text. +#set text(lang: "en") +"She suddenly started speaking french: #text(lang: "fr")['Je suis une banane.']" Roman told me. + +Some people's thought on this would be #text(smart-quotes: false)["strange."] |
