summaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorYip Coekjan <69834864+Coekjan@users.noreply.github.com>2024-10-08 16:37:11 +0800
committerGitHub <noreply@github.com>2024-10-08 08:37:11 +0000
commit7a96c86487fe2eb35d88bd8314b26feec6118898 (patch)
treeffa0ae8cc5138b9f46002c23b66e03b67e847fcf /crates
parent037c0c82160088f5f8026e2b6808db20c874e8ad (diff)
Fix smartquotes after inline equations (#5149)
Diffstat (limited to 'crates')
-rw-r--r--crates/typst/src/text/smartquote.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/crates/typst/src/text/smartquote.rs b/crates/typst/src/text/smartquote.rs
index 9b48c03a..467165b6 100644
--- a/crates/typst/src/text/smartquote.rs
+++ b/crates/typst/src/text/smartquote.rs
@@ -131,9 +131,12 @@ impl SmartQuoter {
}
// If we have a single smart quote, didn't recently open a single
- // quotation, and are after an alphabetic char, interpret this as an
- // apostrophe.
- if !double && opened != Some(false) && before.is_alphabetic() {
+ // quotation, and are after an alphabetic char or an object (e.g. a
+ // math equation), interpret this as an apostrophe.
+ if !double
+ && opened != Some(false)
+ && (before.is_alphabetic() || before == '\u{FFFC}')
+ {
return "’";
}