Remark-MDX plugin #772
Unanswered
leo-petrucci
asked this question in
Q&A
Replies: 1 comment 3 replies
-
HTML seems to be appearing by removing I tried adding the
What's the reason behind this? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I followed the iframe guide to try and get Milkdown to see React components but I haven't been able to get it working.
I don't necessarily want to display React components in Milkdown, but I'd like Milkdown to be able to tell me "This is where component X is in the markdown".
This is my understanding of the guide:
remarkPlugins
tells Milkdown how to parse nodestoMarkdown
method whenever a matching one is foundI'm pretty sure my code should work, however
console.log
ing the nodes doesn't show any of the expected AST formatsremark-mdx
specifies.remark-mdx
usesmdast-util-mdx-jsx
which has the following AST structure:Am I misunderstanding how plugins are supposed to work or is the issue with
remark-mdx
?Edit:
When passing just HTML to Milkdown without any plugins (e.g.
<div>\nTest\n</div>
), that text seems to not appear at all. Does Milkdown parse and eliminate any HTML/JSX before displaying text in the editor?Edit2:
I think I found the culprit.
preset-commonmark
is filtering the HTML out. I'll try reimplementing it and see if I can get it working.Beta Was this translation helpful? Give feedback.
All reactions