From b8b01e98e971ca69e3c05d86a8afef6372e02243 Mon Sep 17 00:00:00 2001 From: Mehak Nasir Date: Mon, 6 Jun 2022 15:17:00 +0500 Subject: [PATCH] fix: mathjax and mathjax inline syntax fix in regexx --- src/components/HTMLLoader.jsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/HTMLLoader.jsx b/src/components/HTMLLoader.jsx index f98734bc..1fe7d661 100644 --- a/src/components/HTMLLoader.jsx +++ b/src/components/HTMLLoader.jsx @@ -23,9 +23,10 @@ const baseConfig = { function HTMLLoader({ htmlNode, componentId, cssClassName }) { const isLatex = htmlNode.match(/(\${1,2})((?:\\.|.)*)\1/) - || htmlNode.match(/(\[mathjax](.+?)\[\\mathjax])+/) - || htmlNode.match(/(\[mathjaxinline](.+?)\[\\mathjaxinline])+/) - || htmlNode.match(/(\\\[(.+?)\\\])+/); + || htmlNode.match(/(\[mathjax](.+?)\[\/mathjax])+/) + || htmlNode.match(/(\[mathjaxinline](.+?)\[\/mathjaxinline])+/) + || htmlNode.match(/(\\\[(.+?)\\\])+/) + || htmlNode.match(/(\\\((.+?)\\\))+/); return ( isLatex ? (