From 2d1c41b698d5105513a71e4ed28330e04aeb0cfa Mon Sep 17 00:00:00 2001
From: Mehak Nasir <67791278+mehaknasir@users.noreply.github.com>
Date: Mon, 23 May 2022 12:36:10 +0500
Subject: [PATCH] Fix: for rendering latex in comments and responses and
support for special symbols in TinyMCE (#160)
* fix: for for rendering latex in comments and responses
* fix: component is seperated for loading html in dom
* feat: added special characters support in tiny-mce
---
src/components/HTMLLoader.jsx | 27 ++++++++++++++++++++
src/components/TinyMCEEditor.jsx | 6 +++--
src/discussions/comments/comment/Comment.jsx | 4 +--
src/discussions/comments/comment/Reply.jsx | 4 +--
src/discussions/posts/post/Post.jsx | 4 +--
src/discussions/posts/post/PostLink.jsx | 4 +--
6 files changed, 39 insertions(+), 10 deletions(-)
create mode 100644 src/components/HTMLLoader.jsx
diff --git a/src/components/HTMLLoader.jsx b/src/components/HTMLLoader.jsx
new file mode 100644
index 00000000..bd139bcd
--- /dev/null
+++ b/src/components/HTMLLoader.jsx
@@ -0,0 +1,27 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+
+import MathJax from 'react-mathjax-preview';
+
+function HTMLLoader({ htmlNode, componentId, cssClassName }) {
+ const isLatex = htmlNode.match(/(\${1,2})((?:\\.|.)*)\1/);
+
+ return (
+ isLatex ?