Skip to content

Unable to render ascii unless I change scriptType in node.js file #15

@himajasuman

Description

@himajasuman

I am trying to render ascii math in my react component,
const mathOptions = { AsciiMath: { useMathMLspacing: true }, tex2jax: { inlineMath: [ ['$', '$'], ['\\(', '\\)'] ] }, "HTML-CSS": { linebreaks: { automatic: true } }, extensions: ['asciimath2jax.js'], jax: ['input/TeX', 'input/AsciiMath', 'output/HTML-CSS'] }; const mathScript = "https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_HTMLorMML"; const mathContent = 'sum_(i=1)\\^n i=(n(n+1))\/2'; itemMarkup = <MathJax.Context options={mathOptions} script={mathScript}> <MathJax.Node>{mathContent}</MathJax.Node> </MathJax.Context>;
I am expecting it to render like
screen shot 2017-07-15 at 2 27 09 pm
but, it is rendering like
screen shot 2017-07-15 at 2 30 42 pm

because, it is rendering like Tex, rather than ascii. If I change
https://github.com/SamyPesse/react-mathjax/blob/master/src/node.js#L121 to
this.script.type = 'math/asciimath; ' + (inline ? '' : 'mode=display');
it works.

is there a way I can pass that config.

Thanks for the wonderful library.

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