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

Pipe symbol | inside code inside table cell is parsed as table separator #60

Closed
4 tasks done
remorses opened this issue Oct 28, 2023 · 3 comments
Closed
4 tasks done
Labels
🙅 no/wontfix This is not (enough of) an issue for this project 👎 phase/no Post cannot or will not be acted on

Comments

@remorses
Copy link

Initial checklist

Affected packages and versions

remark-gfm@4

Link to runnable example

https://stackblitz.com/edit/github-iglaql-z65qwa?file=src%2Fmain.ts

Steps to reproduce

  1. run vite
  2. notice the output is different from input, the pipe symbol (|) is interpreted as a table separator instead of being inside the code block

Expected behavior

A pipe operator inside an inline code should not be parsed as table separator

Actual behavior

Pipe is parsed as table separator

Runtime

Node v16

Package manager

npm 8

OS

No response

Build and bundle tools

No response

@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Oct 28, 2023
@wooorm
Copy link
Member

wooorm commented Oct 28, 2023

Yup, try it on GH:

| a             |
| ---           |
| `'pipe' | and`|
a
`'pipe'

See? The stuff gets lost.
This is a known GH gotcha that we follow.
They solve it in a weird way, which we also do: you cannot normally escape in code, but you can escape pipes in cells in code:

| a             |
| ---           |
| `'pipe' \| and`|
a
'pipe' | and

I wrote some more about all the parsing details of tables here: https://github.com/wooorm/markdown-rs/blob/main/src/construct/gfm_table.rs

@wooorm wooorm closed this as completed Oct 28, 2023
@wooorm wooorm added the 🙅 no/wontfix This is not (enough of) an issue for this project label Oct 28, 2023
@github-actions

This comment has been minimized.

@github-actions github-actions bot added 👎 phase/no Post cannot or will not be acted on and removed 🤞 phase/open Post is being triaged manually labels Oct 28, 2023
@remorses
Copy link
Author

Thank you! I didn't know that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙅 no/wontfix This is not (enough of) an issue for this project 👎 phase/no Post cannot or will not be acted on
Development

No branches or pull requests

2 participants