mirror of
https://github.com/typst/typst
synced 2025-05-14 17:15:28 +08:00
Fix smartquotes after inline equations (#5149)
This commit is contained in:
parent
037c0c8216
commit
7a96c86487
@ -131,9 +131,12 @@ impl SmartQuoter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If we have a single smart quote, didn't recently open a single
|
// If we have a single smart quote, didn't recently open a single
|
||||||
// quotation, and are after an alphabetic char, interpret this as an
|
// quotation, and are after an alphabetic char or an object (e.g. a
|
||||||
// apostrophe.
|
// math equation), interpret this as an apostrophe.
|
||||||
if !double && opened != Some(false) && before.is_alphabetic() {
|
if !double
|
||||||
|
&& opened != Some(false)
|
||||||
|
&& (before.is_alphabetic() || before == '\u{FFFC}')
|
||||||
|
{
|
||||||
return "’";
|
return "’";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BIN
tests/ref/issue-5146-smartquotes-after-equations.png
Normal file
BIN
tests/ref/issue-5146-smartquotes-after-equations.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 240 B |
@ -165,3 +165,6 @@ Some people's thought on this would be #[#set smartquote(enabled: false); "stran
|
|||||||
|
|
||||||
"test"\
|
"test"\
|
||||||
"test"
|
"test"
|
||||||
|
|
||||||
|
--- issue-5146-smartquotes-after-equations ---
|
||||||
|
$i$'s $i$ 's
|
||||||
|
Loading…
x
Reference in New Issue
Block a user