markdown-to-quill-delta
v1.0.1
Published
Convert Markdown to Quill Delta
Readme
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.

