Skip to content

Renderer plugin not working #474

Description

@antoineFrau

Subject of the issue

Hi, I tried to implement remark-math plugin in with react-markdown (https://github.com/antoineFrau/react-markdown-math) to be trigger on Latex and render a MathJax Node.

But of what I saw the plugin is never trigger. I don't know if it's an issue with the remark-math plugin or with react-markdown.

const source= `Lift($L$) can be determined by Lift Coefficient ($C_L$) like the following
  equation.
  
  $$
  L = \frac{1}{2} \rho v^2 S C_L
  $$`;
...
 <ReactMarkdown 
                source={source}
                plugins={[RemarkMathPlugin]}
                renderers={{
                    math: ({ value }) => {
                        console.log("math equation")
                        return <Node>{value}</Node>
                    },
                    inlineMath: ({ value }) =>{
                        console.log("inlineMath equation")
                        return <Node inline={true}>{value}</Node>
                    }
                }}
/>

Your environment

  • OS: MacOS
  • Packages: "react-markdown": "^4.3.1",
    "react-mathjax": "^1.0.1",
    "remark-math": "^4.0.0"
  • Env: Firefox 81.1, yarn 1.22

Steps to reproduce

I pushed a create-react-app with the needed code to test this issue.

Expected behavior

So it should print the console.log() because I have math equation Latex format in my code.
#357

Actual behavior

Doing nothing. Rendering math equation into TextRenderer.
image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions