Skip to content

Commit

Permalink
Close #4116 Use newcommand in place of providecommand for MathJax
Browse files Browse the repository at this point in the history
  • Loading branch information
James-Yu committed Dec 29, 2023
1 parent ab3cf7d commit 5ed7957
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/preview/math/mathpreviewlib/newcommandfinder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function parseAst(content: string, node: Ast.Node): string[] {
lastContent = lastArg.content[lastArg.content.length - 1]
}
const end = (lastArg.content[lastArg.content.length - 1].position?.end.offset ?? -1 - closeBraceOffset) + closeBraceOffset
macros.push(content.slice(start, end + 1))
macros.push(content.slice(start, end + 1).replaceAll(/\\providecommand([^a-zA-Z])/g, '\\newcommand$1'))
}

if ('content' in node && typeof node.content !== 'string') {
Expand Down

0 comments on commit 5ed7957

Please sign in to comment.