Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renderer plugin not working #474

Closed
antoineFrau opened this issue Oct 15, 2020 · 5 comments
Closed

Renderer plugin not working #474

antoineFrau opened this issue Oct 15, 2020 · 5 comments
Labels
💪 phase/solved Post is done 🐛 type/bug This is a problem

Comments

@antoineFrau
Copy link

antoineFrau commented Oct 15, 2020

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

@antoineFrau antoineFrau added 🐛 type/bug This is a problem 🙉 open/needs-info This needs some more info labels Oct 15, 2020
@antoineFrau
Copy link
Author

I just saw that's there is an issue with plugins : #188

@wooorm
Copy link
Member

wooorm commented Oct 15, 2020

Correct. And see #470

@antoineFrau
Copy link
Author

The plan earlier is explained here: #470 (comment).
It seems this PR would be extremely incompatible with the current project. So the plan was instead to mostly bump remark and fix plugins (#425) first. Then do this PR later.

I saw that later my bad.
Do we have a date for the plugin fix ? Do you guys need help on something ?

@wooorm
Copy link
Member

wooorm commented Oct 15, 2020

We’ll cut a major version soon, with the goal of fixing a bunch of bugs, but otherwise not changing too much.

No date other than that. For help: there are a lot of open issues that could use some help!

wooorm added a commit that referenced this issue Oct 16, 2020
* Lowercase filenames to scream less
* Add `remark-cli`, `remark-preset-wooorm` to format prose
* Use imports and fancy new JS features
* Add link to a markdown cheatsheet, as many questions are about that
* Add details tags showing equivalent JSX for examples, to clarify how markdown
  works
* Refactor options list, clean signatures
* Add examples on plugins, plugins w/ options, renderers (syntax highlighting),
  and combining plugins w/ renderers (math)
* Add sections on why to use this, security, contributing, related projects
* Add test for `react-katex` integration

Closes GH-70.
Closes GH-191.
Related to GH-474.
Closes GH-479.
Closes GH-480.
Related to GH-483.
wooorm added a commit that referenced this issue Oct 17, 2020
* Lowercase filenames to scream less
* Add `remark-cli`, `remark-preset-wooorm` to format prose
* Use imports and fancy new JS features
* Add link to a markdown cheatsheet, as many questions are about that
* Add details tags showing equivalent JSX for examples, to clarify how markdown
  works
* Refactor options list, clean signatures
* Add examples on plugins, plugins w/ options, renderers (syntax highlighting),
  and combining plugins w/ renderers (math)
* Add sections on why to use this, security, contributing, related projects
* Add test for `react-katex` integration

Closes GH-70.
Closes GH-191.
Related to GH-474.
Closes GH-479.
Closes GH-480.
Related to GH-483.
wooorm added a commit that referenced this issue Oct 17, 2020
* Lowercase filenames to scream less
* Add `remark-cli`, `remark-preset-wooorm` to format prose
* Use imports and fancy new JS features
* Add link to a markdown cheatsheet, as many questions are about that
* Add details tags showing equivalent JSX for examples, to clarify how markdown
  works
* Refactor options list, clean signatures
* Add examples on plugins, plugins w/ options, renderers (syntax highlighting),
  and combining plugins w/ renderers (math)
* Add sections on why to use this, security, contributing, related projects
* Add test for `react-katex` integration

Closes GH-70.
Closes GH-191.
Related to GH-474.
Closes GH-479.
Closes GH-480.
Related to GH-483.
Closes GH-485.

Reviewed-by: Christian Murphy <christian.murphy.42@gmail.com>
Reviewed-by: Espen Hovlandsdal <espen@hovlandsdal.com>
@wooorm
Copy link
Member

wooorm commented Oct 19, 2020

Fixed in 5.0.0!

@wooorm wooorm closed this as completed Oct 19, 2020
@wooorm wooorm added ⛵️ status/released 🐛 type/bug This is a problem and removed 🐛 type/bug This is a problem 🙉 open/needs-info This needs some more info labels Oct 19, 2020
@wooorm wooorm added the 💪 phase/solved Post is done label Aug 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💪 phase/solved Post is done 🐛 type/bug This is a problem
Development

No branches or pull requests

2 participants