Using <span class="math-tex"> while parsing HTML in React

387 Views Asked by At

I'm trying to parse HTML containing <span class="math-tex"> to render math equations in react, from an existing database.

From what I've found the <span class="math-tex"> element is from a CKEditor widget, but I can't figure out how to use it with React and html-react-parser.

I've tried using

npm install ckeditor4-react

and putting

<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-AMS_CHTML"></script>

into my index.html but it doesn't seem to work.

The goal is to use

Parser("some HTML containing <span class="math-tex"> elements")

to display equations on my react app

Thanks for any pointers you have.

0

There are 0 best solutions below