Browse Source

fix: Improved regex for task item rich text

pull/7046/head
Muhammed Mustafa 8 months ago
parent
commit
3d6a64e58e
  1. 4
      packages/nc-gui/helpers/dbTiptapExtensions/task-item.ts

4
packages/nc-gui/helpers/dbTiptapExtensions/task-item.ts

@ -9,7 +9,7 @@ export interface TaskItemOptions {
taskListTypeName: string
}
export const inputRegex = /^\s*(\[([( |x])?\])\s$/
export const inputRegex = /^\s*\[( |x)?\]\s$/i
export const TaskItem = Node.create<TaskItemOptions>({
name: 'taskItem',
@ -178,7 +178,7 @@ export const TaskItem = Node.create<TaskItemOptions>({
find: inputRegex,
type: this.type,
getAttributes: (match) => ({
checked: match[match.length - 1] === 'x',
checked: match[match.length - 1].toLowerCase() === 'x',
}),
}),
]

Loading…
Cancel
Save