add more content, add tests to the tasklist extension

This commit is contained in:
Hans Pagel
2020-11-03 17:05:27 +01:00
parent 34a3a7fe26
commit d69b8778d6
11 changed files with 145 additions and 28 deletions

View File

@@ -1,16 +1,18 @@
# TaskList
This extension enables you to use task lists in the editor. They are rendered as `<ul>` HTML tags.
This extension enables you to use task lists in the editor. They are rendered as `<ul data-type="task_list">`. This implementation doesnt require any framework, its using plain JavaScript only.
Type <code>[ ]&nbsp;</code> or <code>[x]&nbsp;</code> at the beginning of a new line and it will magically transform to a task list.
## Installation
::: warning Use with TaskItem
The `TaskList` extension is intended to be used with the [`TaskItem`](/api/extensions/task-item) extension. Make sure to import that one too, otherwise youll get a SyntaxError.
This extension requires the [`TaskItem`](/api/nodes/task-item) extension.
:::
```bash
# With npm
# with npm
npm install @tiptap/extension-task-list @tiptap/extension-task-item
# Or: With Yarn
# with Yarn
yarn add @tiptap/extension-task-list @tiptap/extension-task-item
```
@@ -28,4 +30,4 @@ yarn add @tiptap/extension-task-list @tiptap/extension-task-item
[packages/extension-task-list/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-task-list/)
## Usage
<demo name="Nodes/TaskList" />
<demo name="Nodes/TaskList" highlight="3-5,17-18,37-38" />