vscode-markdown icon indicating copy to clipboard operation
vscode-markdown copied to clipboard

Table Formatter adds border pipes when they were origninally omitted

Open AndrewDDavis opened this issue 1 year ago • 1 comments

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:

  1. Col A | Col B | Col C
    ----- | ----- | -----
    A1    | B1    | C1
    A2    | B2    | C2 
    A3    | B3    | C3
    
  2. | 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

  1. Copy the table using Syntax 1 from the example above into a markdown document.
  2. Format the document with Markdown All-in-One.
  3. Observe that pipes and whitespace were added around the table.

AndrewDDavis avatar Jun 05 '23 17:06 AndrewDDavis