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.

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.needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions