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 inline code and vertical bars in tables #420

Merged
merged 3 commits into from
Jul 19, 2019
Merged

Fix inline code and vertical bars in tables #420

merged 3 commits into from
Jul 19, 2019

Conversation

wooorm
Copy link
Member

@wooorm wooorm commented Jul 11, 2019

This PR fixes inline code in table cells. Previously. Inline code got preference over the table cell itself. This was added due to GH-73 in GH-83 four years ago.

That behaviour does not match current GFM and let to unexpected results in GH-295, GH-320, and GH-396.

Additionally, inline code cannot be empty in CM/GFM.

Related to GH-73.
Related to GH-83.
Closes GH-295.
Closes GH-320.
Closes GH-396.

@wooorm wooorm added 🐛 type/bug This is a problem remark-parse labels Jul 11, 2019
@wooorm wooorm requested a review from a team July 11, 2019 21:13
@wooorm wooorm changed the title This PR fixes inline code in table cells. WIP: Fix inline code and vertical bars in tables Jul 11, 2019
@wooorm
Copy link
Member Author

wooorm commented Jul 13, 2019

/cc @ikatyang What do you think?

Also /cc @zeke: Do you think this may be a bug with how GH renders Markdown? Do you think empty code (see #320 (comment)) should be supported in cells? Should I raise this with GH / ping GFM maintainers? CM/GFM does not support inline code.

@ikatyang
Copy link
Contributor

Since GFM is widely adopted, matching GFM should be better I think. And of course it's even better if it could be fixed on the GFM side.

@wooorm wooorm marked this pull request as ready for review July 19, 2019 10:47
@wooorm wooorm changed the title WIP: Fix inline code and vertical bars in tables Fix inline code and vertical bars in tables Jul 19, 2019
Previously, inline code got preference over the table cell itself.
This was added due to GH-73 in GH-83 four years ago.

That behaviour does not match current GFM and lead to unexpected results in
GH-295, GH-320, and GH-396.

**This PR fixes them, but introduces a conundrum: GFM does not allow empty
inline code in cells. Which is weird. Should we support that (why not? 🤷) or
match GFM?**

Related to GH-73.
Related to GH-83.
Closes GH-295.
Closes GH-320.
Closes GH-396.
* Remove support for empty inline code
* Only trim inline code content by one character on both sides, if
  both the initial and final character are a space or a line feed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 participants