add HTMLAttributes to defaultoptions
This commit is contained in:
@@ -1,25 +1,29 @@
|
||||
import { createNode, mergeAttributes } from '@tiptap/core'
|
||||
import { wrappingInputRule } from 'prosemirror-inputrules'
|
||||
|
||||
export const inputRegex = /^\s*(\[([ |x])\])\s$/
|
||||
|
||||
export interface TaskItemOptions {
|
||||
nested: boolean,
|
||||
HTMLAttributes: {
|
||||
[key: string]: any
|
||||
},
|
||||
}
|
||||
|
||||
export const inputRegex = /^\s*(\[([ |x])\])\s$/
|
||||
|
||||
const TaskItem = createNode({
|
||||
name: 'taskItem',
|
||||
|
||||
defaultOptions: <TaskItemOptions>{
|
||||
nested: false,
|
||||
HTMLAttributes: {},
|
||||
},
|
||||
|
||||
content() {
|
||||
return this.options.nested ? '(paragraph|taskList)+' : 'paragraph+'
|
||||
},
|
||||
|
||||
defining: true,
|
||||
|
||||
defaultOptions: <TaskItemOptions>{
|
||||
nested: false,
|
||||
},
|
||||
|
||||
addAttributes() {
|
||||
return {
|
||||
checked: {
|
||||
|
||||
Reference in New Issue
Block a user