Repository: showdownjs/showdown (js)

Issue:
Tasklist does not comply GFM
Hi,

I recommend to adjust `var rgx` in [makehtml.links](https://github.com/showdownjs/showdown/blob/master/src/subParsers/makehtml/links.js) to 
```js
var rgx = /(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x| )][ \t]+)?[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gim
````

since GFM expects a space character after the task list item marker 

> A task list item is a list item where the first block in it is a paragraph which begins with a task list item marker and at least one whitespace character before any other content.
https://github.github.com/gfm/#task-list-items-extension-


Pull request description:
fix(lists): Fix tasklists to comply with GFM
GFM requires a whitespace between brackets for tasklists.
Lists with empty brackets at the beginning shouldn't be converted to tasklists.

Closes #655

Patch:
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) {


Test patch:
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 @@
 <h1 id="mythings">my things</h1>
 <ul>
     <li>foo</li>
-    <li class="task-list-item" style="list-style-type: none;"><input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"> bar</li>
+    <li>[] bar</li>
     <li class="task-list-item" style="list-style-type: none;"><input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"> baz</li>
     <li class="task-list-item" style="list-style-type: none;"><input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;" checked> bazinga</li>
+    <li class="task-list-item" style="list-style-type: none;"><input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;" checked> bazinga 2</li>
 </ul>
 <p>otherthings</p>
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