diff --git a/src/rules.js b/src/rules.js index 4f99615dd5..538303f330 100644 --- a/src/rules.js +++ b/src/rules.js @@ -92,7 +92,7 @@ block.normal = merge({}, block); block.gfm = merge({}, block.normal, { table: '^ *([^\\n ].*\\|.*)\\n' // Header - + ' {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)\\|?' // Align + + ' {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?' // Align + '(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)' // Cells }); diff --git a/test/specs/new/space_after_table.html b/test/specs/new/space_after_table.html index 911d4aedea..152258d0f3 100644 --- a/test/specs/new/space_after_table.html +++ b/test/specs/new/space_after_table.html @@ -13,4 +13,4 @@ -
there should be a single space in the line above
+there should be a single space at the end of every line above
diff --git a/test/specs/new/space_after_table.md b/test/specs/new/space_after_table.md index 385ffe6229..94b80d6a49 100644 --- a/test/specs/new/space_after_table.md +++ b/test/specs/new/space_after_table.md @@ -1,8 +1,8 @@ --- gfm: true --- -| a | b | -|---|---| -| 1 | 2 | +| a | b | +|---|---| +| 1 | 2 | -there should be a single space in the line above \ No newline at end of file +there should be a single space at the end of every line above