diff --git a/packages/jupyter-ai/src/components/rendermime-markdown.tsx b/packages/jupyter-ai/src/components/rendermime-markdown.tsx index 046c2b542..ba2c27ddb 100644 --- a/packages/jupyter-ai/src/components/rendermime-markdown.tsx +++ b/packages/jupyter-ai/src/components/rendermime-markdown.tsx @@ -15,8 +15,8 @@ type RendermimeMarkdownProps = { /** * Escape LaTeX delimeters by adding extra backslashes where needed for proper rendering by @jupyterlab/rendermime. */ -function escapeLatexDelimiters(latexString: string) { - return latexString +function escapeLatexDelimiters(str: string) { + return str .replace(/\\\(/g, '\\\\(') .replace(/\\\)/g, '\\\\)') .replace(/\\\[/g, '\\\\[')