Skip to content

GFM tables: escaped escapes are incorrectly treated as escapes #277

Open
@wooorm

Description

@wooorm

Take this example:

| Head          |
| ------------- |
| A | Alpha     |
| B \| Bravo    |
| C \\| Charlie |
| D \\\| Delta  |
| E \\\\| Echo  |

Yields:

Head
A
B | Bravo
C | Charlie
D \| Delta
E \| Echo

To explain, this is a table with one column (because the header row / delimiter row each have one cell).
That means that “Alpha” disappears: body rows with superfluous columns, drop those columns.
It also makes sense that “Bravo” (and “Delta) show: the pipes are escaped, so they both are part of the one cell in their row.

However, this issue is about the cases of “Charlie” (and “Echo”). They appear, but should disappear like “Alpha”. The backslashes are themselves escaped: they should not escape the pipe.

Taking a different example from markdown:

*a*

\*b*

\\*c*

a

*b*

\c

…both a and c are emphasised, the escape only “works” for b.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions