Skip to content
This repository has been archived by the owner on Mar 13, 2021. It is now read-only.

Commit

Permalink
fix for markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
philipparndt committed Nov 22, 2020
1 parent dd8808b commit be17617
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ttMarkdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class MarkdownParser implements tt.Parser {

isSeparatorRow(text: string): boolean {
const cleaned = text.replace(/\s+/g, '');
return cleaned.startsWith('|-') || cleaned.startsWith('|:-');
return (cleaned.startsWith('|-') || cleaned.startsWith('|:-')) && cleaned.match(/^[:|-\s]+$/) ? true : false;
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/commands.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ suite('Commands', () => {
test('Regression: Format under cursor causes loss of data.', async () => {
const testCase =
`| A| B|
| -1| -1|`;
| -1| -1|`;
const expected =
`| A | B |
| -1 | -1 |`;
Expand Down

0 comments on commit be17617

Please sign in to comment.