Period and slash are ordinary characters in math (#1855)

This commit is contained in:
damaxwell 2023-08-05 02:02:38 -08:00 committed by GitHub
parent ad55755f33
commit ba0990f189
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 2 deletions

View File

@ -216,7 +216,7 @@ impl GlyphFragment {
pub fn with_id(ctx: &MathContext, c: char, id: GlyphId, span: Span) -> Self {
let class = match c {
':' => Some(MathClass::Relation),
'⋯' | '⋱' | '⋰' | '⋮' => Some(MathClass::Normal),
'.' | '/' | '⋯' | '⋱' | '⋰' | '⋮' => Some(MathClass::Normal),
_ => unicode_math_class::class(c),
};
let mut fragment = Self {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

@ -31,3 +31,7 @@ $ a dotsq b \
#let normal = math.class.with("normal")
#let pluseq = $class("binary", normal(+) normal(=))$
$ a pluseq 5 $
---
// Test exceptions.
$ sqrt(3)\/2 quad d_0.d_1d_2 dots $

View File

@ -42,10 +42,13 @@ $ mat(
---
// Test #460 equations.
#let stop = {
math.class("punctuation",$.$)
}
$ mat(&a+b,c;&d, e) $
$ mat(&a+b&,c;&d&, e) $
$ mat(&&&a+b,c;&&&d, e) $
$ mat(.&a+b&.,c;.....&d&....., e) $
$ mat(stop &a+b&stop,c;...stop stop&d&...stop stop, e) $
---
// Test #454 equations.