Every extension
taskList
A checklist.
The checkbox is real DOM rather than a `::before`, because a checklist people cannot tick with the mouse is a bulleted list with extra steps. It carries `contenteditable="false"` so the caret never lands inside it.
Adding it
import { createEditor, document, paragraph, text, taskList } from '@matrajs/core'
const editor = createEditor({
extensions: [document, paragraph, text, taskList],
element: document.querySelector('#editor'),
})
There is no separate package · taskList is already in @matrajs/core, and an extension you do not import is not in your bundle. document, paragraph and text are the floor every document needs.
Commands
-
editor.commands.toggleTaskList()
Keys
- Mod-Shift-7 ·
toggleTaskList
HTML
-
Parses
ul[data-type="taskList"] -
Renders
ul
Styles
This one needs a stylesheet to look right, and ships the minimum as a string rather than a file · nothing is loaded unless you load it.
import { taskListCSS } from '@matrajs/core'
const style = document.createElement('style')
style.textContent = taskListCSS
document.head.append(style)