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

In a github table, an inline code block that contains a | adds columns - it should not #64

Closed
Thraka opened this issue Jun 19, 2018 · 3 comments

Comments

@Thraka
Copy link

Thraka commented Jun 19, 2018

When a pipe is in a table, you can escape it with a \ on github markdown. In hexo-renderer-marked this does not work. As seen below, it works as intended here. But if you copy paste that table into hexo-renderer-marked row3 cell2 will behave just like row2 cell2 without an escape.

|col1 |col2 |
|-----|-----|
|row1|`cell2`|
|row2|`this cell2 has no | escape on the pipe`|
|row3|`this cell2 has an \| escape on the pipe`|
col1 col2
row1 cell2
row2 `this cell2 has no
row3 this cell2 has an | escape on the pipe
@demurgos
Copy link

Table syntax are not part of commonmark but an extension by marked and GFM.
Older versions of marked and GFM diverged on this, but a recent marked PR addressed the issue.

The marked demo seems to render the example in the OP the same way as GFM. Updating the dependency to marked@0.4.0 should fix the issue.

@Thraka
Copy link
Author

Thraka commented Jun 20, 2018

I'm not super familiar with nodejs and npm. How do I make sure I get the specific version, and how do I make sure that the renderer will use it? I tried running npm install --save marked@0.4.0 which it seemed to have updated but it didn't fix the problem. I want to make sure that I did indeed change the marked version that the renderer is using.

Thanks!

@demurgos
Copy link

This has to be fixed in this package here, not in your app. The version range is not compatible. This is a breaking change so it would require some checks before updating it.

@Thraka Thraka closed this as completed Nov 13, 2018
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

2 participants