diff --git a/src/components/HTMLLoader.jsx b/src/components/HTMLLoader.jsx index 89f345f8..f98734bc 100644 --- a/src/components/HTMLLoader.jsx +++ b/src/components/HTMLLoader.jsx @@ -3,6 +3,24 @@ import PropTypes from 'prop-types'; import MathJax from 'react-mathjax-preview'; +const baseConfig = { + showMathMenu: true, + tex2jax: { + inlineMath: [ + ['$', '$'], + ['\\(', '\\)'], + ['[mathjaxinline]', '[/mathjaxinline]'], + ], + displayMath: [ + ['[mathjax]', '[/mathjax]'], + ['$$', '$$'], + ['\\[', '\\]'], + ], + }, + + skipStartupTypeset: true, +}; + function HTMLLoader({ htmlNode, componentId, cssClassName }) { const isLatex = htmlNode.match(/(\${1,2})((?:\\.|.)*)\1/) || htmlNode.match(/(\[mathjax](.+?)\[\\mathjax])+/) @@ -10,7 +28,15 @@ function HTMLLoader({ htmlNode, componentId, cssClassName }) { || htmlNode.match(/(\\\[(.+?)\\\])+/); return ( - isLatex ? + isLatex ? ( + + ) // eslint-disable-next-line react/no-danger :
); diff --git a/src/components/PostPreviewPane.jsx b/src/components/PostPreviewPane.jsx index 1d8b33b2..6498583b 100644 --- a/src/components/PostPreviewPane.jsx +++ b/src/components/PostPreviewPane.jsx @@ -14,7 +14,7 @@ function PostPreviewPane({ htmlNode, intl, isPost }) { return ( <> {showPreviewPane && ( -
+
setShowPreviewPane(false)} className="float-right text-primary-500 mb" />