diff --git a/lib/lex/block.js b/lib/lex/block.js index 96fc6f6..60cc47d 100644 --- a/lib/lex/block.js +++ b/lib/lex/block.js @@ -319,7 +319,7 @@ Lexer.prototype.token = function(src, top, bq) { type: 'table', header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */), align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), - cells: cap[3].replace(/(?: *\| *)?\n$/, '').split('\n').slice(0), + cells: cap[3].replace(/( *\| *)?\n$/, '$1').split('\n').slice(0), }; for (i = 0; i < item.align.length; i++) { diff --git a/test/tests/gfm_tables.html b/test/tests/gfm_tables.html index 70bec82..6497f2a 100644 --- a/test/tests/gfm_tables.html +++ b/test/tests/gfm_tables.html @@ -35,3 +35,12 @@
| Heading 1 | Heading 2 |
|---|---|
| Cell 1 | |
| Cell 3 |