Skip to content

Commit

Permalink
fix: fixed #2530
Browse files Browse the repository at this point in the history
  • Loading branch information
arnog committed Dec 2, 2024
1 parent 48447ac commit 931d079
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## [Unreleased]

### Issues Resolved

- **#2530** The AsciiMath `1/2` is now parsed as `\frac{1}{2}`

## 0.102.0 _2024-11-29_

### Issues Resolved
Expand Down
5 changes: 3 additions & 2 deletions src/formats/parse-math-string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,9 @@ function parseMathExpression(
return `\\text{${m[1]}}${parseMathExpression(m[2], options)}`;
}

m = s.match(/^([^a-zA-Z0-9\(\{\[\_\^\\\s"]+)(.*)/);;
// A string of symbols...
m = s.match(/^([^a-zA-Z0-9\(\{\[\_\^\\\s"]+)(.*)/);
// Starts with a string of symbols, e.g. "=123", ">=b"
// Exclude "123x" or "abc="
// Could be a binary or relational operator, etc...
if (m) {
return `${paddedShortcut(m[1], inlineShortcuts)}${parseMathExpression(
Expand Down

0 comments on commit 931d079

Please sign in to comment.