react-mathjax icon indicating copy to clipboard operation
react-mathjax copied to clipboard

HTML does not render properly

Open mjyoung opened this issue 5 years ago • 1 comments

In the mathjax.org demo you can do something like this:

<p>This some some paragraph text.</p>

<strong>And here's some bold text with a linebreak.</strong><br />

If `y = 10`, what is `x` when `x = y/5 + 4`?

and it would render HTML properly: image

This doesn't work with react-mathjax2:

<MathJax.Context
  input="ascii"
>
  <div>
    <div>
      <h2>With MathJax.Text</h2>
      <MathJax.Text text={asciiText} />
    </div>

    <div>
      <h2>With MathJax.Node</h2>
      <MathJax.Node>{asciiText}</MathJax.Node>
    </div>
  </div>
</MathJax.Context>

image

mjyoung avatar Apr 10 '19 17:04 mjyoung

im just fix text.js in src with

render() { const { classes, options } = this.props; return ( <div> <div key={ this.props.text } ref={ (div) => this.div = div } dangerouslySetInnerHTML={{ __html: this.props.text }} /> </div> ); }

and compiled it through babel

AnshiLeFlay avatar Jun 05 '19 12:06 AnshiLeFlay