chore: support both $$ and $ latex format (#5723)
This commit is contained in:
parent
a6356be348
commit
9513155fa4
1 changed files with 2 additions and 1 deletions
|
|
@ -44,7 +44,8 @@ const preprocessLaTeX = (content: string) => {
|
|||
if (typeof content !== 'string')
|
||||
return content
|
||||
return content.replace(/\\\[(.*?)\\\]/gs, (_, equation) => `$$${equation}$$`)
|
||||
.replace(/\\\((.*?)\\\)/gs, (_, equation) => `$${equation}$`)
|
||||
.replace(/\\\((.*?)\\\)/gs, (_, equation) => `$$${equation}$$`)
|
||||
.replace(/(^|[^\\])\$(.+?)\$/gs, (_, prefix, equation) => `${prefix}$${equation}$`)
|
||||
}
|
||||
|
||||
export function PreCode(props: { children: any }) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue