mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-01 01:19:03 +08:00
fix: add checkboxes to TaskItem HTML output, fix #2037
This commit is contained in:
parent
8fc915cade
commit
c94d2b0517
@ -45,12 +45,32 @@ export const TaskItem = Node.create<TaskItemOptions>({
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
renderHTML({ HTMLAttributes }) {
|
renderHTML({ node, HTMLAttributes }) {
|
||||||
return ['li', mergeAttributes(
|
return [
|
||||||
this.options.HTMLAttributes,
|
'li',
|
||||||
HTMLAttributes,
|
mergeAttributes(
|
||||||
{ 'data-type': 'taskItem' },
|
this.options.HTMLAttributes,
|
||||||
), 0]
|
HTMLAttributes,
|
||||||
|
{ 'data-type': 'taskItem' },
|
||||||
|
),
|
||||||
|
[
|
||||||
|
'label',
|
||||||
|
[
|
||||||
|
'input',
|
||||||
|
{
|
||||||
|
type: 'checkbox',
|
||||||
|
checked: node.attrs.checked
|
||||||
|
? 'checked'
|
||||||
|
: null,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
['span'],
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'div',
|
||||||
|
0,
|
||||||
|
],
|
||||||
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
addKeyboardShortcuts() {
|
addKeyboardShortcuts() {
|
||||||
|
Loading…
Reference in New Issue
Block a user