diff --git a/src/components/module/dashboard/docs/DocsPage.tsx b/src/components/module/dashboard/docs/DocsPage.tsx index 36d9371..541ac9a 100644 --- a/src/components/module/dashboard/docs/DocsPage.tsx +++ b/src/components/module/dashboard/docs/DocsPage.tsx @@ -44,20 +44,20 @@ export default function DocsPage() { // Replace $$ expressions with KaTeX rendering const htmlWithMath = docsMenu[menuActive].content; const renderedHtml = htmlWithMath.replace( - /\$\$(.*?)\$\$/g, + /(? { return katex.renderToString(mathExpression); } ); // Replace $ expressions with KaTeX rendering - const finalRenderedHtml = renderedHtml.replace( - /\$(.*?)\$/g, + const secondRenderedHtml = renderedHtml.replace( + /(? { return katex.renderToString(mathExpression, { displayMode: false }); } ); - + const finalRenderedHtml = secondRenderedHtml.replaceAll("\\$", "$"); setDocsContent(finalRenderedHtml); }, [menuActive, docsMenu]);