Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table formatting incorrectly handles pipes (|) #24

Closed
xa0082249956 opened this issue Jul 30, 2017 · 6 comments
Closed

Table formatting incorrectly handles pipes (|) #24

xa0082249956 opened this issue Jul 30, 2017 · 6 comments
Assignees
Labels
Area: Document formatting Related to source code formatter. Area: Table GitHub Flavored Markdown table. Res: Out of scope
Milestone

Comments

@xa0082249956
Copy link

xa0082249956 commented Jul 30, 2017

新建一个 Markdown 文件,输入这些内容:
Create a Markdown file and type this:

| 233 | 666 |
| --- | --- |
| `|` | 233 |

按下 Alt + Shift + F:
Press Alt + Shift + F:

| 233 | 666 |
| --- | --- |
| `   | `   | 233 |

vscode_1805

@xa0082249956 xa0082249956 changed the title Formatting - Wrong formatting when table contains I Formatting - Wrong formatting when Table contains I Jul 30, 2017
@yzhang-gh
Copy link
Owner

好的,看到了
(话说你这个录动图的软件是什么呀)

@xa0082249956
Copy link
Author

ScreentoGif
按键显示 keycastOW

@yzhang-gh
Copy link
Owner

谢谢

@Lemmingh
Copy link
Collaborator

@yzhang-gh
@xa0082249956
@vonagam

https://github.github.com/gfm/#example-200


The correct behavior is:

|HA|HB|
|-|-|
|`1|2`|3|

<!-- gets: -->

| HA  | HB  |
| --- | --- |
| `1  | 2`  | 3 |
|HA|HB|
|-|-|
|`1\|2`|3|

<!-- gets: -->

| HA     | HB  |
| ------ | --- |
| `1\|2` | 3   |

GitHub made the decision in April 2017:
github/cmark-gfm#24 (comment)

@yzhang-gh
Copy link
Owner

yzhang-gh commented Dec 13, 2020

I've pushed a change so that it aligns with the GFM spec.

Remaining issues:

  • Code span syntax decoration isn't right in this case
  • VS Code hasn't updated its markdown-it to the latest version yet (so the preview tab still has the old behavior).

@Lemmingh
Copy link
Collaborator

Lemmingh commented Dec 13, 2020

VS Code Insiders is already using markdown-it 12.0.3, which aligns with the latest GFM.

I suddenly realized that currently published 1.53.0-insider is 76436a4d43566cd313629799e2ec51b4d00caa64. It is older than master which contains 92723a8a2c88041d59bdefade50cbff8254d486e.

Anyway, it's sure that we will see VS Code 1.53.0 shipped with markdown-it 12.0.3 in February 2021.

@Lemmingh Lemmingh added this to the Next milestone Dec 13, 2020
@Lemmingh Lemmingh changed the title Formatting - Wrong formatting when Table contains I Table formatting incorrectly handles pipes (|) Aug 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Document formatting Related to source code formatter. Area: Table GitHub Flavored Markdown table. Res: Out of scope
Projects
None yet
Development

No branches or pull requests

3 participants