Skip to content

Write a inline code block containing \| in a table cell seems to be impossible #7

@DWaveletT

Description

@DWaveletT

Initial checklist

Affected package

mdast-util-gfm-table

Steps to reproduce

Consider this source code, it tries to render three inline code blocks (\\|, \| and |) in the table:

| Two backslashes and a pipe | A backslash and a pipe | A single pipe |
| -------------------------- | ---------------------- | ------------- |
| `\\\|`                     | `\\|`                  | `\|`          |

Actual behavior

The inline block in the (2, 2) cell is broken, and looks like this:

Two backslashes and a pipe A backslash and a pipe A single pipe
\\| `\ `

It seems that render a inline code block in the table cell containing \| is impossible.

In other inline spans such as strong, we can escape backslash with backslash to solve this problem. However, since inline code block does not allow escaping backslash, we cannot do as the same way.

| Two backslashes and a pipe | A backslash and a pipe | A single pipe |
| -------------------------- | ---------------------- | ------------- |
| **\\\\\|**                 | **\\\|**               | **\|**        |
Two backslashes and a pipe A backslash and a pipe A single pipe
\\| \| |

Expected behavior

The inline code block in the (2, 2) cell should work properly. (Or exist a method to achieve the same effect).

Runtime

No response

Package manager

No response

Operating system

No response

Build and bundle tools

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    👎 phase/noPost cannot or will not be acted on🙅 no/wontfixThis is not (enough of) an issue for this project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions