summaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorJeremie Knuesel <knuesel@gmail.com>2024-09-26 11:09:32 +0200
committerGitHub <noreply@github.com>2024-09-26 09:09:32 +0000
commit4827f28a940b9610e55afb888ddde11e240caa20 (patch)
tree6006e8ab9c69f430d7d20d677fb0e9878e1b2fbf /crates
parent8d38bd406669dacb1c9819f92a94fda2178dc452 (diff)
Fix smartquotes for Swiss French (#4992)
Diffstat (limited to 'crates')
-rw-r--r--crates/typst/src/text/smartquote.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/crates/typst/src/text/smartquote.rs b/crates/typst/src/text/smartquote.rs
index 0bcccf41..9b48c03a 100644
--- a/crates/typst/src/text/smartquote.rs
+++ b/crates/typst/src/text/smartquote.rs
@@ -207,8 +207,8 @@ impl<'s> SmartQuotes<'s> {
/// Currently, the supported languages are: English, Czech, Danish, German,
/// Swiss / Liechtensteinian German, Estonian, Icelandic, Italian, Latin,
/// Lithuanian, Latvian, Slovak, Slovenian, Spanish, Bosnian, Finnish,
- /// Swedish, French, Hungarian, Polish, Romanian, Japanese, Traditional
- /// Chinese, Russian, Norwegian, and Hebrew.
+ /// Swedish, French, Swiss French, Hungarian, Polish, Romanian, Japanese,
+ /// Traditional Chinese, Russian, Norwegian, and Hebrew.
///
/// For unknown languages, the English quotes are used as fallback.
pub fn get(
@@ -227,6 +227,10 @@ impl<'s> SmartQuotes<'s> {
false => ("‹", "›", "«", "»"),
true => low_high,
},
+ "fr" if matches!(region, Some("CH")) => match alternative {
+ false => ("‹\u{202F}", "\u{202F}›", "«\u{202F}", "\u{202F}»"),
+ true => default,
+ },
"cs" | "da" | "de" | "sk" | "sl" if alternative => ("›", "‹", "»", "«"),
"cs" | "de" | "et" | "is" | "lt" | "lv" | "sk" | "sl" => low_high,
"da" => ("‘", "’", "“", "”"),