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

Fix table/list parsing ambiguity #767

Merged
merged 2 commits into from Mar 27, 2021
Merged

Conversation

hukkin
Copy link
Contributor

@hukkin hukkin commented Mar 26, 2021

Fix parsing of

a | b
- | -
1 | 2

Markdown-it parses it as a table, but it should not be one, because there is a list on the second line that intercepts the table.

The GFM spec says:

A leading and trailing pipe is also recommended for clarity of reading, and if there’s otherwise parsing ambiguity.

Also GitHub's own parser parses this as a list, not a table.

@puzrin puzrin merged commit cd5296f into markdown-it:master Mar 27, 2021
@hukkin hukkin deleted the table-ambiguity branch March 27, 2021 11:12
@laurent22
Copy link

laurent22 commented Mar 2, 2023

This actually introduces a regression for everybody who was writing their table without leading pipes. See here for example. Is this change really necessary? If there's a parsing ambiguity, then this ambiguity still exists after this change, and the only difference is that it broke a lot of existing Markdown documents.

@rlidwka
Copy link
Member

rlidwka commented May 26, 2023

@laurent22 answered in laurent22/joplin#7858 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants