remarkjs / react-remark

React component and hook to use remark to render markdown
https://remarkjs.github.io/react-remark
MIT License
204 stars 7 forks source link

Remark plugins are not working #41

Closed ChristopherPAndrews closed 2 years ago

ChristopherPAndrews commented 2 years ago

Initial checklist

Affected packages and versions

react-remark 2.1.0 and remark-gfm 3.0.1

Link to runnable example

https://stackblitz.com/edit/react-ts-zf4r6n?file=index.tsx

Steps to reproduce

The linked code shows the problem. When I add a remark plugin (in this instance remark-gfm, but I also tried remark-math), there is no output and no errors.

I also tried this using the hook version and got null as the rendered content.

If I dial back the version of remark-gfm to 1.0 as it is in this project's package.json, then it works as expected.

Expected behavior

I expected the markdown to be converted to HTML and the table in github flavored markdown to be correctly rendered.

Actual behavior

Nothing is output at all, and there are no warning or error messages in the console.

Runtime

No response

Package manager

No response

OS

No response

Build and bundle tools

No response

ChristianMurphy commented 2 years ago

React-remark is currently using remark 13, meaning remark plugins need to be remark 13 compatible. For example remark-gfm 1 is remark 13 compatible: https://stackblitz.com/edit/react-ts-vv9vh1?file=index.tsx

The next major release will support remark 14, and newer versions of remark-gfm https://github.com/remarkjs/react-remark/pull/39

ChristianMurphy commented 2 years ago

Nothing is output at all, and there are no warning or error messages in the console

This is a bit annoying, but not something react-remark itself can fix. Managing version compatibility between plugins in remark is something which could be done in remark/unified, but thus far has opted to be documentation based.

newtmex commented 2 years ago

HI @ChristianMurphy Nice plugin you made here.

Any ETA for the next major release that will support remark 14?

ChristianMurphy commented 2 years ago

No ETA currently, will probably be a couple months until I can circle back and start to look into the remaining migration items again