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

Issues with pipes inside of backpacks inside a table #24

Closed
skyzyx opened this issue May 1, 2017 · 4 comments
Closed

Issues with pipes inside of backpacks inside a table #24

skyzyx opened this issue May 1, 2017 · 4 comments

Comments

@skyzyx
Copy link

skyzyx commented May 1, 2017

Actual Result:

This used to work as expected.

Parameter Type Description
id `integer null`
description string The description for the approval resource, if available.

Expected Result:

Parameter Type Description
id integer|null The identifier for the approval resource, if available.
description string The description for the approval resource, if available.
@kivikakk
Copy link

kivikakk commented May 1, 2017

This is now intended behaviour — we revised the spec when it became apparent that there were some nasty edge cases with trying to correctly detect the pipe | outside a span (such as backticks) when there were multiple adjacent emphasis markers. You can see some of the history at #18, #19 and #21.

@kivikakk kivikakk closed this as completed May 1, 2017
@Crissov
Copy link

Crissov commented May 10, 2017

This issue has been discussed in the Commonmark Discourse as well.

As a user, I almost always don't want vertical bars | to trump backticks ` – nothing should trump them and you cannot even backslash-escape anything else (including a backtick) within a backtick span \ `.
As a spec writer and implementer, I understand the benefits of clearly separating block and inline parsing. The question, though, is whether table cells are blocks or inlines.

@kivikakk
Copy link

👋 @Crissov

As a user, I didn't want that either — that's why I went to quite so much effort to make it work correctly. Like any developer, too, I wasn't really happy about throwing that away in #21 for this "solution", but unfortunately when confronted with situations like in #18, it turned out to be unsustainable; the edge cases get weirder and weirder, and trying to cover them up (#19) just makes for an even harder to explain system, the edge cases get even stranger, and the code starts to become a nightmare. (We ended up parsing inlines three times for each row there, iirc.)

Simply put, there's not a great, consistent way to do this. I think it does make sense to consider the table cell structure at the block level, inasmuch as they're not spanned by delimiters but rather separated by them. It's easiest to consider the entire table structure one large block which in parsed in its entirety, before inline parsing then happens, which is also literally the case.

@Crissov
Copy link

Crissov commented May 12, 2017

As I said, I understand it from a developer's POV. Anyway, wouldn't it work to parse for inline code spans ` (without linebreaks inside) first, then blocks and finally inlines? [No, may break code blocks with backticks inside.]

dbarnett added a commit to google/vroom that referenced this issue Apr 13, 2020
Escape pipe characters with backslash since even inside backticks,
GitHub flavored markdown treats it as a table delimiter, not a literal pipe.

See github/cmark-gfm#24 for background.

(Thanks to @flwyd for pointing this out!)
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

No branches or pull requests

3 participants