diff --git a/src/Tokenizer.js b/src/Tokenizer.js index eb42793c9b..2efb3b7ea7 100644 --- a/src/Tokenizer.js +++ b/src/Tokenizer.js @@ -369,7 +369,7 @@ export class Tokenizer { type: 'table', header: splitCells(cap[1]).map(c => { return { text: c }; }), align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), - rows: cap[3] ? cap[3].replace(/\n[ \t]*$/, '').split('\n') : [] + rows: cap[3] && cap[3].trim() ? cap[3].replace(/\n[ \t]*$/, '').split('\n') : [] }; if (item.header.length === item.align.length) { diff --git a/test/specs/new/tab_newline.html b/test/specs/new/tab_newline.html index 77e5010172..8ff7040210 100644 --- a/test/specs/new/tab_newline.html +++ b/test/specs/new/tab_newline.html @@ -36,3 +36,10 @@
code
 
+ + + + + + +
y
diff --git a/test/specs/new/tab_newline.md b/test/specs/new/tab_newline.md index 5058d77d54..395b42b5d8 100644 --- a/test/specs/new/tab_newline.md +++ b/test/specs/new/tab_newline.md @@ -9,4 +9,7 @@ | y | | - | | x | - code \ No newline at end of file + code +| y | +| - | + \ No newline at end of file