diff --git a/lib/marked.js b/lib/marked.js index f34e2df0bc..51faeffb7b 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -249,7 +249,7 @@ Lexer.prototype.token = function(src, top) { } // table no leading pipe (gfm) - if (top && (cap = this.rules.nptable.exec(src))) { + if (cap = this.rules.nptable.exec(src)) { item = { type: 'table', header: splitCells(cap[1].replace(/^ *| *\| *$/g, '')), @@ -447,7 +447,7 @@ Lexer.prototype.token = function(src, top) { } // table (gfm) - if (top && (cap = this.rules.table.exec(src))) { + if (cap = this.rules.table.exec(src)) { item = { type: 'table', header: splitCells(cap[1].replace(/^ *| *\| *$/g, '')), diff --git a/test/new/list_table.html b/test/new/list_table.html new file mode 100644 index 0000000000..3a8b6388b7 --- /dev/null +++ b/test/new/list_table.html @@ -0,0 +1,44 @@ +
Table in list:
+column1 | +column2 | +
---|---|
value1 | +value2 | +
value3 | +value4 | +
No leading pipe table in list:
+column1 | +column2 | +
---|---|
value1 | +value2 | +
value3 | +value4 | +