mehdisadeghi / react-mathjax-preview

The MathJax React component you were looking for.
https://mehdisadeghi.github.io/react-mathjax-preview/
MIT License
49 stars 30 forks source link

Broken rendering on component update #66

Open proitm opened 3 years ago

proitm commented 3 years ago

We discovered a bug that prevents proper LaTeX formula re-rendering if the formula changes.

How to reproduce (Google Chrome):

  1. Open https://mehdisadeghi.github.io/react-mathjax-preview/
  2. Copy and paste this LaTeX: $$ \begin{equation} \label{eq1} \begin{split} A & = \frac{\pi r^2}{2} \\ & = \frac{1}{2} \pi r^2 \end{split} \end{equation} $$
  3. Append any text in the editor.
  4. The formula rendering breaks. It shows a box with LaTeX code.
mehdisadeghi commented 3 years ago

Interesting bug indeed and a great opportunity for making a pull request :)