Skip to content

Markdown tables can silently discard content containing | #159186

Description

@kpreid

Code

//! This is a table with some columns:
//!
//! | col1 | col2 | col3 | col4 |
//! | ---- | ---- | ---- | ---- |
//! | `one` | `two` | three | four |
//! | `code_with(|arg| arg)` |  `code_with(|arg| arg)` | three | four |

Reproduction Steps

cargo doc

Expected Outcome

Table should contain all the text I wrote, or an error or warning should be reported.

Actual Output

The table entries are split on pipes disregarding the code backticks, and the resulting "extra columns" are silently discarded:

Image

This is apparently the specified behavior of GitHub-Flavored-Markdown tables, but it is certainly surprising. There should be at least a warning that content is being discarded.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions