Skip to content

Cannot render markdown while using library with ReactMarkdown #15

@seppar93

Description

@seppar93

Currently, my application uses the ReactMarkdown package to display my text and I've tried to embed my it with mathjax however cannot have everything displayed properly.
also using import RemarkMathPlugin from 'remark-math' to parse math from text

    ...props,
    plugins: [RemarkMathPlugin],
    renderers: {
      ...props.renderers,
      math: props => <MathJax.Text inline />,
      inlineMath: props => <MathJax.Text inline />
    }
  };
  return (
    <div className='QDocMarkdownComponent'>
      <MathJax.Context
        input='ascii'
        onLoad={() => console.log('Loaded MathJax script!')}
        onError={(MathJax, error) => {
          console.warn(error);
          console.log('Encountered a MathJax error, re-attempting a typeset!');
          MathJax.Hub.Queue(MathJax.Hub.Typeset());
        }}
        script='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=AM_HTMLorMML'
        options={{
          asciimath2jax: {
            useMathMLspacing: true,
            delimiters: [['$$', '$$']],
            preview: 'none'
          }
        }}>
        <ReactMarkdown escapeHtml={false} {...newProps} />
      </MathJax.Context>
    </div>
  );```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions