diff --git a/lib/marked.js b/lib/marked.js index 462229d233..78703975f5 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -45,7 +45,7 @@ block.def = edit(block.def) .getRegex(); block.bullet = /(?:[*+-]|\d{1,9}\.)/; -block.item = /^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/; +block.item = /^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/; block.item = edit(block.item, 'gm') .replace(/bull/g, block.bullet) .getRegex(); @@ -342,7 +342,7 @@ Lexer.prototype.token = function(src, top) { // Remove the list item's bullet // so it is seen as the next token. space = item.length; - item = item.replace(/^ *([*+-]|\d+\.) +/, ''); + item = item.replace(/^ *([*+-]|\d+\.) */, ''); // Outdent whatever the // list item contains. Hacky. diff --git a/test/specs/commonmark/commonmark-spec.js b/test/specs/commonmark/commonmark-spec.js index 7669ab3da1..35790288c9 100644 --- a/test/specs/commonmark/commonmark-spec.js +++ b/test/specs/commonmark/commonmark-spec.js @@ -248,7 +248,7 @@ describe('CommonMark 0.28 List items', function() { var section = 'List items'; // var shouldPassButFails = []; - var shouldPassButFails = [237, 236, 227, 218, 243, 259, 241, 239, 247, 246, 225, 220, 258, 260, 244]; + var shouldPassButFails = [237, 236, 227, 218, 243, 259, 241, 239, 247, 225, 220, 258, 260]; var willNotBeAttemptedByCoreTeam = []; @@ -263,7 +263,7 @@ describe('CommonMark 0.28 Lists', function() { var section = 'Lists'; // var shouldPassButFails = []; - var shouldPassButFails = [282, 270, 280, 278, 273, 274, 264, 265, 276, 279, 267, 269]; + var shouldPassButFails = [282, 270, 280, 278, 273, 274, 264, 265, 279, 267, 269]; var willNotBeAttemptedByCoreTeam = [];