Skip to content

Nextjs blog with markdown and wanting to add presentation #438

Answered by yhatt
knandraina asked this question in Q&A
Discussion options

You must be logged in to vote

The output of Marp Core is framework-agnostic. When using Marp Core in Next.js, typically you have to set raw HTML by React's dangerouslySetInnerHTML.
https://react.dev/reference/react-dom/components/common#dangerously-setting-the-inner-html

See also <Marp> component designed for https://marp.app/ made by Next.js. It has many tricks, for reducing the client bundle size, making CSS scope by Shadow DOM, executing the client script for browser, and applying Web Fonts in cross-browser correctly.
https://github.com/marp-team/marp/blob/main/website/components/Marp.tsx

FYI: Marp Core has a very huge bundle size due to math libraries (MathJax, KaTeX). In the latest Next.js, I recommend to use Ma…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by yhatt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants