diff --git a/CHANGELOG.md b/CHANGELOG.md index 59ad46530..1d75fe6b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/formats/parse-math-string.ts b/src/formats/parse-math-string.ts index 9e89291fa..7f9654d57 100644 --- a/src/formats/parse-math-string.ts +++ b/src/formats/parse-math-string.ts @@ -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(