Skip to content

Commit

Permalink
fix: fix space at end of table line (#2201)
Browse files Browse the repository at this point in the history
  • Loading branch information
UziTech committed Sep 8, 2021
1 parent b445b64 commit 910f0f0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
});

Expand Down
2 changes: 1 addition & 1 deletion test/specs/new/space_after_table.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
</tbody>
</table>

<p>there should be a single space in the line above</p>
<p>there should be a single space at the end of every line above</p>
8 changes: 4 additions & 4 deletions test/specs/new/space_after_table.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
gfm: true
---
| a | b |
|---|---|
| 1 | 2 |
| a | b |
|---|---|
| 1 | 2 |

there should be a single space in the line above
there should be a single space at the end of every line above

1 comment on commit 910f0f0

@vercel
Copy link

@vercel vercel bot commented on 910f0f0 Sep 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.