diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-01-27 15:09:05 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-01-27 15:32:05 +0100 |
| commit | 2e039cb052fcb768027053cbf02ce396f6d7a6be (patch) | |
| tree | b1a1c1da0440805b296e3204fa30cd9666322a0e /src/syntax/parser.rs | |
| parent | a59b9fff93f708d5a35d2bf61c3b21efee71b7e9 (diff) | |
Fix math spacing bugs
Diffstat (limited to 'src/syntax/parser.rs')
| -rw-r--r-- | src/syntax/parser.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/syntax/parser.rs b/src/syntax/parser.rs index d8eeed24..f6ed2f5d 100644 --- a/src/syntax/parser.rs +++ b/src/syntax/parser.rs @@ -308,7 +308,12 @@ fn math_delimited(p: &mut Parser, stop: MathClass) { p.eat(); let m2 = p.marker(); while !p.eof() && !p.at(SyntaxKind::Dollar) { - if math_class(p.current_text()) == Some(stop) { + let class = math_class(p.current_text()); + if stop == MathClass::Fence && class == Some(MathClass::Closing) { + break; + } + + if class == Some(stop) { p.wrap(m2, SyntaxKind::Math); p.eat(); p.wrap(m, SyntaxKind::MathDelimited); |
