Neighborly Package Megalodon
Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

storyblok-markdown-richtext

1.0.1 • Public • Published

HTML/Markdown to Richtext converter

This tool helps you to parse html/markdown and convert it into the JSON format of Storyblok's richtext field.

Usage

Install the npm module storyblok-markdown-richtext:

$ 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`)
 
// ...

Functions

markdownToRichtext

Transform html/markdown data into a Richtext object

import { markdownToRichtext } from 'storyblok-markdown-richtext'
 
markdownToRichtext(`# Hello World`)
/**
 * // Richtext object
{
  type: 'doc',
  content: [
    {
      type: 'heading',
      attrs: {
        level: 1
      },
      content: [
        {
          text: 'Hello World',
          type: 'text'
        }
      ]
    }
  ]
}
 *
* /

Powered by Storyblok

Install

npm i storyblok-markdown-richtext

DownloadsWeekly Downloads

15

Version

1.0.1

License

MIT

Unpacked Size

79.6 kB

Total Files

21

Last publish

Collaborators

  • avatar
  • avatar
  • avatar
  • avatar