simov / markdown-viewer

Markdown Viewer / Browser Extension
MIT License
1.08k stars 135 forks source link

If the table contains inline-coded `|`, it will be broken #165

Closed Yarakashi-Kikohshi closed 2 years ago

Yarakashi-Kikohshi commented 2 years ago

If the table contains inline-coded |, it will be broken

When creating table containing inline-coded vertical bar, the table is broken.

demo

|                contents                | description       |
| :------------------------------------: | :---------------- |
| If the table contains inline-coded `|` | it will be broken |

Result of displaying

tabel-in-inlineCoeded-verticalBar

This problem occurs in both Remark and Marked compilers. Of course, this problem doesn't seem to depend on the CSS theme.

Version info.

Microsoft Edge 96.0.1054.62 (64bit)
Markdown Viewer 4.0

Thank you for the very easy-to-use extension!

simov commented 2 years ago

Yes, that seems to be a compiler issue.

Yarakashi-Kikohshi commented 2 years ago

Should this issue be raised by remark.js or marked.js? If so, I will close this issue.

simov commented 2 years ago

Yes, it is part of what the compiler/parser does. They may have a fix for it already, in that case I will have to update the version used here.

Yarakashi-Kikohshi commented 2 years ago

Thank you for your prompt reply!!:smile:

And, I checked the issue of each repository. Similar issues were discussed in each compiler's repository, but I couldn't find the conclusion I expected.

I'm going to put up with it until the problem is resolved.:persevere:

Current status regarding this issue

marked.js

In marked.js, it seems to be stuck due to regex problems.

cf. The vertical bars within backsticks shouldn't be interpreted as table cell delimiter. · Issue #1375 · markedjs/marked

remark.js

In remark.js, inline-coded | is interpreted as a table, which is the same behavior as GFM, so it does not seem to correspond at present.

cf. Fix inline code and vertical bars in tables by wooorm · Pull Request #420 · remarkjs/remark

wooorm commented 2 years ago

The displayed result matches how GH does it btw, try pasting it here:

contents description
If the table contains inline-coded | it will be broken
Yarakashi-Kikohshi commented 2 years ago

@wooorm Yes. I found out by looking at issue # 420 of remark.js.

I think it's important to look similar to GH, but I don't want `|` to be considered part of the table. It seems that mark.js will support the notation I am expecting, so I wait until then...:persevere: