To use quilljs-markdown as a standard Quill module, register it using Quill.register and pass the configuration via the modules object in the Quill constructor. This is the recommended way to integrate it into a standard Quill setup.
Configuration Options:
ignoreTags: An array of tag names (e.g., ['pre', 'strikethrough']) that the markdown parser should ignore.tags: An object defining custom regex patterns for specific markdown tags. Each tag entry requires a pattern key.
Example registration and initialization:
import Quill from 'quill'
import QuillMarkdown from 'quilljs-markdown'
const options = {
theme: 'snow',
modules: {
toolbar: [['bold', 'italic', 'underline', 'strike'], ['link', 'image']],
QuillMarkdown: {
ignoreTags: [ 'pre', 'strikethrough'],
tags: {
blockquote: { pattern: /^(\|){1,6}\s/g },
bold: { pattern: /^(\|){1,6}\s/g },
italic: { pattern: /(\_){1}(.+?)(?:\1){1}/g },
},
}
}
}
// Register the module
Quill.register('modules/QuillMarkdown', QuillMarkdown, true)
// Initialize Quill
new Quill('#editor', options)