From 82ab0b436dec9ac807ca796741bf47d5802d8038 Mon Sep 17 00:00:00 2001 From: Jon Gacnik <jon@folderstudio.com> Date: Sat, 15 Oct 2016 21:00:05 -0700 Subject: [PATCH] [continuelist addon] Add tasklist support --- addon/edit/continuelist.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addon/edit/continuelist.js b/addon/edit/continuelist.js index df5179fe4..6574ea335 100644 --- a/addon/edit/continuelist.js +++ b/addon/edit/continuelist.js @@ -11,8 +11,8 @@ })(function(CodeMirror) { "use strict"; - var listRE = /^(\s*)(>[> ]*|[*+-]\s|(\d+)([.)]))(\s*)/, - emptyListRE = /^(\s*)(>[> ]*|[*+-]|(\d+)[.)])(\s*)$/, + var listRE = /^(\s*)(>[> ]*|- \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/, + emptyListRE = /^(\s*)(>[> ]*|- \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/, unorderedListRE = /[*+-]\s/; CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) { @@ -39,7 +39,7 @@ } else { var indent = match[1], after = match[5]; var bullet = unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0 - ? match[2] + ? match[2].replace("x", " ") : (parseInt(match[3], 10) + 1) + match[4]; replacements[i] = "\n" + indent + bullet + after; -- GitLab