diff --git a/src/subParsers/makehtml/lists.js b/src/subParsers/makehtml/lists.js index e22dcd1..1473a9c 100644 --- a/src/subParsers/makehtml/lists.js +++ b/src/subParsers/makehtml/lists.js @@ -40,7 +40,7 @@ showdown.subParser('makehtml.lists', function (text, options, globals) { // attacklab: add sentinel to emulate \z listStr += '¨0'; - var rgx = /(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm, + var rgx = /(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm, isParagraphed = (/\n[ \t]*\n(?!¨0)/.test(listStr)); // Since version 1.5, nesting sublists requires 4 spaces (or 1 tab) indentation, @@ -48,7 +48,7 @@ showdown.subParser('makehtml.lists', function (text, options, globals) { // activating this option reverts to old behavior // This will be removed in version 2.0 if (options.disableForced4SpacesIndentedSublists) { - rgx = /(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm; + rgx = /(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm; } listStr = listStr.replace(rgx, function (wholeMatch, m1, m2, m3, m4, taskbtn, checked) { diff --git a/test/functional/makehtml/cases/features/#164.4.tasklists.html b/test/functional/makehtml/cases/features/#164.4.tasklists.html index cf6ccdf..6a343fa 100644 --- a/test/functional/makehtml/cases/features/#164.4.tasklists.html +++ b/test/functional/makehtml/cases/features/#164.4.tasklists.html @@ -1,8 +1,9 @@
otherthings
diff --git a/test/functional/makehtml/cases/features/#164.4.tasklists.md b/test/functional/makehtml/cases/features/#164.4.tasklists.md index 0054490..047eed3 100644 --- a/test/functional/makehtml/cases/features/#164.4.tasklists.md +++ b/test/functional/makehtml/cases/features/#164.4.tasklists.md @@ -4,5 +4,6 @@ - [] bar - [ ] baz - [x] bazinga + - [X] bazinga 2 otherthings