vscode-markdown
vscode-markdown copied to clipboard
Table Formatter adds border pipes when they were origninally omitted
What's the problem
According to the GFM Table Spec, "The pipes on either end of the table are optional." So, the following table syntaxes are both valid:
-
Col A | Col B | Col C ----- | ----- | ----- A1 | B1 | C1 A2 | B2 | C2 A3 | B3 | C3
-
| Col A | Col B | Col C | | ----- | ----- | ----- | | A1 | B1 | C1 | | A2 | B2 | C2 | | A3 | B3 | C3 |
However, when formatting the document, Markdown All-in-One changes the tables written using Syntax 1 into Syntax 2 (adding pipes on either end). This is undesirable for authors who prefer the first, more compact, syntax (sometimes called borderless tables).
What's the expected result
Markdown All-in-One should omit the pipes at either end of a table if they were originally omitted by the author.
How to reproduce
- Copy the table using Syntax 1 from the example above into a markdown document.
- Format the document with Markdown All-in-One.
- Observe that pipes and whitespace were added around the table.