mirror of
https://github.com/typst/typst
synced 2025-08-20 01:48:34 +08:00
Fix formatting v2
This commit is contained in:
parent
bb8b7a66ba
commit
3dc9acf4b3
@ -189,16 +189,17 @@ fn styled_char(styles: StyleChain, c: char, auto_italic: bool) -> char {
|
|||||||
let bold = EquationElem::bold_in(styles);
|
let bold = EquationElem::bold_in(styles);
|
||||||
let default_style = EquationElem::default_style_in(styles);
|
let default_style = EquationElem::default_style_in(styles);
|
||||||
let default_italic = match c {
|
let default_italic = match c {
|
||||||
'a'..='z' | 'ħ' | 'ı' | 'ȷ' | 'α'..='ω' | 'ϵ' | 'ϑ' | 'ϰ' | 'ϕ' | 'ϱ' | 'ϖ' => {
|
'a'..='z' | 'ħ' | 'ı' | 'ȷ' | 'α'..='ω' | 'ϵ' | 'ϑ' | 'ϰ' | 'ϕ' | 'ϱ' | 'ϖ' =>
|
||||||
|
{
|
||||||
matches!(default_style, MathStyle::Iso | MathStyle::Tex | MathStyle::French)
|
matches!(default_style, MathStyle::Iso | MathStyle::Tex | MathStyle::French)
|
||||||
}
|
}
|
||||||
'A'..='Z' => matches!(default_style, MathStyle::Iso | MathStyle::Tex),
|
'A'..='Z' => matches!(default_style, MathStyle::Iso | MathStyle::Tex),
|
||||||
'Α'..='Ω' => matches!(default_style, MathStyle::Iso),
|
'Α'..='Ω' => matches!(default_style, MathStyle::Iso),
|
||||||
'∂' => matches!(default_style, MathStyle::Tex | MathStyle::French),
|
'∂' => matches!(default_style, MathStyle::Tex | MathStyle::French),
|
||||||
_ => false
|
_ => false,
|
||||||
};
|
};
|
||||||
let italic = EquationElem::italic_in(styles)
|
let italic = EquationElem::italic_in(styles)
|
||||||
.unwrap_or(auto_italic && default_italic && matches!(variant, Sans | Serif));
|
.unwrap_or(auto_italic && default_italic && matches!(variant, Sans | Serif));
|
||||||
|
|
||||||
if let Some(c) = basic_exception(c) {
|
if let Some(c) = basic_exception(c) {
|
||||||
return c;
|
return c;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user