💡 Proposal: Replacing RecursiveMarkdown with Marker-Based JSX Injection #3
mayank1513
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey everyone 👋🏼
We’ve been exploring ways to improve performance and flexibility in
@m2d/react-markdown, especially around JSX injection within Markdown (inspired by MDX-style flows).❌ Problem with
<RecursiveMarkdown />✅ New Direction — Marker-Based JSX Injection
Instead of recursive parsing of children, we propose:
🧩 Approach
Replace JSX with markers
Preprocess markdown and replace components with markers like:
<!--$$jsx-block-uuid123$$-->Track mapping
Keep a runtime mapping of
uuid → JSX.Element:Inject via plugin
remarkplugin replaces markers with nodes pointing to React components.Update
astRef🧠 Why this matters
🧪 Example Use
📣 Call for Feedback
We’d love your thoughts on:
And if you’re interested in helping build this out — plugin logic, test cases, or SSR edge cases — drop a comment below 👇🏼
🙏🏼 Thanks for being part of this journey.
@m2d/react-markdownis growing rapidly, and your feedback shapes the direction.Let’s make Markdown, JSX, and DOCX play even nicer. ⚡
Beta Was this translation helpful? Give feedback.
All reactions