Our great sponsors
-
Strapi
🚀 Strapi is the leading open-source headless CMS. It’s 100% JavaScript/TypeScript, fully customizable and developer-first.
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
This means that you can transform your HTML with tools like rehype or remark. You can find out more about the available options here.
What if you wanted to render a raw string that contains Markdown? Example use-case: You want the flexibility of being able to serve Markdown content from a CMS (such as Strapi) without having to make changes to a .md file.
This means that you can transform your HTML with tools like rehype or remark. You can find out more about the available options here.
There are a few ways you can achieve this, in this solution we'll be using mdsvex to convert the Markdown into HTML format, then rendering that HTML. mdsvex is a Markdown preprocessor which is essentially a wrapper for MDX, making it compatible for Svelte.
If you're not using SvelteKit, check out the MDsveX docs for alternative installations, if you are:
Related posts
- MDSveX: The bridge between Markdown and Svelte
- I built an Markdown editor using Next.js and TailwindCss 🔥
- I built a markdown editor using monaco - VScode's editor
- Create an Interactive Table of Contents for a Next.js Blog with Remark
- Example of Powerful Markdown Editor combining Svelte-Exmarkdown and Skeleton