markdown-to-quill-delta
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

NPM
Build Status

Markdown to Quill Delta converter

Converts Markdown to Quill Delta using remark.

Status

Feature Status
Paragraphs
Headers
Text
Strong
Emphasis
Delete
Code blocks
Quote blocks
Lists
Checkboxes
Links ✅¹
Images
Custom Extension

¹: reference-style links are not yet supported

Usage

import markdownToDelta from 'markdown-to-quill-delta'
const ops = markdownToDelta(markdown)

Custom Extension:

import markdownToDelta from 'markdown-to-quill-delta'
const input = '---'
const ops = markdownToDelta(input, {
  handle: ({ node, ops }) => {
    if (node.type === 'thematicBreak') {
      ops.push(
        {
          attributes: {
            class: 'cut-off',
          },
          insert: {
            'cut-off': {
              type: '0',
              url: 'https://i0.hdslb.com/bfs/article/0117cbba35e51b0bce5f8c2f6a838e8a087e8ee7.png',
            },
          },
        },
        {
          insert: '\n',
        },
      )
      return true
    }
  },
})

What about Delta to Markdown?

See here.

License

Developed by Sebastian Frysztak.
Licensed under ISC License.

Package Sidebar

Install

npm i markdown-to-quill-delta

Weekly Downloads

1,216

Version

1.0.1

License

ISC

Unpacked Size

11.6 kB

Total Files

4

Last publish

Collaborators

  • rxliuli
  • frysztak