Skip to content

Rustdoc does not display a table in some cases involving whitespaces #65802

Closed
@dutchmartin

Description

@dutchmartin

When placing a space between the line comment start //! and the start of the table |, the table does not render properly:

//! # Lorem ispum cratus test amet
//!
//!This table has no space between the `//!` and the table start character `|`:
//!
//!| a | s | d | f | g |
//!|---|---|---|---|---|
//!| h | j | k | l | ; |
//!
//! This table has space between the `//!` and the table start character `|`:
//!
//! | a | s | d | f | g |
//! |---|---|---|---|---|
//! | h | j | k | l | ; |
//!

image

If you remove the spaces, it works:

//! # Lorem ispum cratus test amet
//!
//!This table has no space between the `//!` and the table start character `|`:
//!
//!| a | s | d | f | g |
//!|---|---|---|---|---|
//!| h | j | k | l | ; |
//!
//! This table has space between the `//!` and the table start character `|`:
//!
//!| a | s | d | f | g |
//!|---|---|---|---|---|
//!| h | j | k | l | ; |
//!

image

I have made a example repo.
To test this, just clone the repo and run cargo doc --open
I have validated that this bug affects stable, beta and nightly

Metadata

Metadata

Assignees

Labels

A-rustdoc-uiArea: Rustdoc UI (generated HTML)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