
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
storyblok-markdown-richtext
Advanced tools
Do you need help converting HTML or markdown into Storyblok's richtext format?
Here's how to use it:
Install the npm module storyblok-markdown-richtext by running:
$ yarn add storyblok-markdown-richtext # npm install storyblok-markdown-richtext
And use the functions where you need:
import { markdownToRichtext } from 'storyblok-markdown-richtext'
const richtextData = markdownToRichtext(`# Hello World`)
// ...
To convert HTML to richtext, you'll also need an HTML to markdown converter. In the example below, we use turndown.
import TurndownService from 'turndown'
import { markdownToRichtext } from 'storyblok-markdown-richtext'
const turndownService = new TurndownService()
const richtextData = markdownToRichtext(
turndownService.turndown('<h1>Hello world!</h1>')
)
This function transforms your HTML or markdown data into a richtext JSON object. Here's an example:
import { markdownToRichtext } from 'storyblok-markdown-richtext'
const richtextObject = markdownToRichtext(`# Hello World`)
The resulting richtext object will look like this:
{
type: 'doc',
content: [
{
type: 'heading',
attrs: {
level: 1
},
content: [
{
text: 'Hello World',
type: 'text'
}
]
}
]
}
FAQs
A library to transform markdown to Richtext data
The npm package storyblok-markdown-richtext receives a total of 1,800 weekly downloads. As such, storyblok-markdown-richtext popularity was classified as popular.
We found that storyblok-markdown-richtext demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.