Classify dots.c, dots.down, dots.up and dots.v as normal (#1726)

Fixes #713. They were previously classified by Unicode as relations, which caused a '+' sign after one of them to be treated as a unary operator rather than a binary operator. This PR overrides the Unicode classification and classifies them as normal instead, which causes a '+' sign after one of them to be properly treated as a binary operator.
This commit is contained in:
Liam Murphy 2023-07-18 00:08:19 +10:00 committed by GitHub
parent c98c3d1a38
commit e0e797c27d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 1 deletions

View File

@ -216,6 +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),
_ => unicode_math_class::class(c),
};
let mut fragment = Self {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -11,7 +11,8 @@ $a not b$ \
$a+b, a*b$ \
$sum x, sum(x)$ \
$sum product x$ \
$f(x), zeta(x), "frac"(x)$
$f(x), zeta(x), "frac"(x)$ \
$a+dots.c+b$
---
// Test ignored vs non-ignored spaces.