Skip to content

Commit 82ab0b4

Browse files
jongacnikmarijnh
authored andcommitted
[continuelist addon] Add tasklist support
1 parent 6fde117 commit 82ab0b4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

addon/edit/continuelist.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
})(function(CodeMirror) {
1212
"use strict";
1313

14-
var listRE = /^(\s*)(>[> ]*|[*+-]\s|(\d+)([.)]))(\s*)/,
15-
emptyListRE = /^(\s*)(>[> ]*|[*+-]|(\d+)[.)])(\s*)$/,
14+
var listRE = /^(\s*)(>[> ]*|- \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,
15+
emptyListRE = /^(\s*)(>[> ]*|- \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,
1616
unorderedListRE = /[*+-]\s/;
1717

1818
CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) {
@@ -39,7 +39,7 @@
3939
} else {
4040
var indent = match[1], after = match[5];
4141
var bullet = unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0
42-
? match[2]
42+
? match[2].replace("x", " ")
4343
: (parseInt(match[3], 10) + 1) + match[4];
4444

4545
replacements[i] = "\n" + indent + bullet + after;

0 commit comments

Comments
 (0)