diff --git a/lib/marked.js b/lib/marked.js index 2062d703..76a0b890 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -16,7 +16,7 @@ var block = { lheading: /^([^\n]+)\n *(=|-){3,}/, hr: /^( ?[\-*_]){3,}/, blockquote: /^ *>[^\n]*(?:\n *>[^\n]*)*/, - list: /^(?: *(\*|\+|-|\d+\.)[^\n]+(?:\n[^\n]+)*(?:\n{1,2}|$)){2,}/g, + list: /^(?:( *)(\*|\+|-|\d+\.)[^\n]+(?:\n[^\n]+)*(?:\n{1,2}|$)){2,}/g, html: /^<([^\/\s>]+)[^\n>]*>[^\n]*(?:\n[^\n]+)*\n?<\/\1>/, text: /^[^\n]+/ }; @@ -128,7 +128,7 @@ block.token = function(str, tokens) { ).test(cap[0]); tokens.push({ type: 'list_start', - ordered: isFinite(cap[1]) + ordered: isFinite(cap[2]) }); // get each top-level // item in the list diff --git a/test/in.md b/test/in.md index 99a8c272..8d23daf9 100644 --- a/test/in.md +++ b/test/in.md @@ -23,7 +23,6 @@ markdown.js doesnt acknowledge arbitrary html blocks =/ The last item * List Item 3 The final item. - * List Item 4 The real final item.