Skip to content

frysztak/markdown-to-quill-delta

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Convert Markdown to Quill Delta

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •