Skip to content

Commit

Permalink
Merge pull request #1395 from mccraveiro/empty-list
Browse files Browse the repository at this point in the history
Fix empty list items
  • Loading branch information
styfle authored Dec 20, 2018
2 parents 27145cc + a0c8eea commit e5e5b09
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/marked.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions test/specs/commonmark/commonmark-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];

Expand All @@ -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 = [];

Expand Down

0 comments on commit e5e5b09

Please sign in to comment.