mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-27 23:15:15 +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 }) {
|
||||
return ['li', mergeAttributes(
|
||||
this.options.HTMLAttributes,
|
||||
HTMLAttributes,
|
||||
{ 'data-type': 'taskItem' },
|
||||
), 0]
|
||||
renderHTML({ node, HTMLAttributes }) {
|
||||
return [
|
||||
'li',
|
||||
mergeAttributes(
|
||||
this.options.HTMLAttributes,
|
||||
HTMLAttributes,
|
||||
{ 'data-type': 'taskItem' },
|
||||
),
|
||||
[
|
||||
'label',
|
||||
[
|
||||
'input',
|
||||
{
|
||||
type: 'checkbox',
|
||||
checked: node.attrs.checked
|
||||
? 'checked'
|
||||
: null,
|
||||
},
|
||||
],
|
||||
['span'],
|
||||
],
|
||||
[
|
||||
'div',
|
||||
0,
|
||||
],
|
||||
]
|
||||
},
|
||||
|
||||
addKeyboardShortcuts() {
|
||||
|
Loading…
Reference in New Issue
Block a user