Skip to content

Commit 547c9d5

Browse files
authored
Use correct todo detection regex (#9968)
Signed-off-by: Nikolay Marchuk <[email protected]>
1 parent a3ca05d commit 547c9d5

File tree

1 file changed

+2
-2
lines changed
  • plugins/text-editor-resources/src/components/extension/todo

1 file changed

+2
-2
lines changed

plugins/text-editor-resources/src/components/extension/todo/todo.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,10 @@ export const TodoListExtension = TaskList.extend({
118118

119119
const todoItemInputRule: () => InputRule = () =>
120120
new InputRule({
121-
find: /^\s*(\[([( |x|*])?\])\s$/,
121+
find: /^\s*(\[([ xX*])?\])\s$/,
122122
handler: ({ state, match, range }) => {
123123
const attributes = {
124-
checked: match[match.length - 1] === 'x' || match[match.length - 1] === '*'
124+
checked: match[2] != null && match[2] !== ' '
125125
}
126126

127127
const type = state.schema.nodes.todoItem

0 commit comments

Comments
 (0)