content icon indicating copy to clipboard operation
content copied to clipboard

Real-time Markdown Preview with @nuxt/content for Client-side Editing

Open axh-xecoy opened this issue 7 months ago • 1 comments

When using @nuxt/content for client-side Markdown editing (users creating new pages), how can I preview the rendered result in real-time?

Current challenges:

The client cannot directly transform Markdown to HTML because @nuxt/content's components (e.g., <ContentRenderer> from components/content) rely on server-side processing. Must I send Markdown to the server, transform it, then send it back to the client for preview? This approach introduces latency.

I'm trying to achieve real-time client-side preview but facing obstacles due to the server-side nature of components/content integration. How can I resolve this?

Thank you!

axh-xecoy avatar May 30 '25 09:05 axh-xecoy

You can use parseMarkdown from @nuxtjs/mdc to parse your content on the client side and render it. @nuxtjs/mdc is the parsing/rendering core of Nuxt Content.

Check out <MDCRenderer> example of @nuxtjs/mdc https://github.com/nuxt-modules/mdc#mdcrenderer

farnabaz avatar Jun 04 '25 08:06 farnabaz

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Aug 03 '25 08:08 github-actions[bot]

This issue was closed because it has been stalled for 30 days with no activity.

github-actions[bot] avatar Sep 02 '25 09:09 github-actions[bot]