Skip to content

Rustdoc does not format ASCII art containing ### at the start of a line correctly #105527

Closed

Description

I tried this code:

//! This is some documentation with ASCII art:
//!
//! ```text
//! #..#.####.#....#.....##..
//! #..#.#....#....#....#..#.
//! ####.###..#....#....#..#.
//! #..#.#....#....#....#..#.
//! #..#.#....#....#....#..#.
//! #..#.####.####.####..##..
//! ```

I expected to see this happen: When I run rustdoc, I expect to see ASCII art in the output that matches the above example.

Instead, this happened: In the output, this actually appears:

#..#.####.#....#.....##..
#..#.#....#....#....#..#.
###.###..#....#....#..#.
#..#.#....#....#....#..#.
#..#.#....#....#....#..#.
#..#.####.####.####..##..

It appears that if a line starts with at least three #s, one gets "swallowed" somehow.

Meta

rustc --version --verbose:

rustc 1.65.0 (897e37553 2022-11-02)
binary: rustc
commit-hash: 897e37553bba8b42751c67658967889d11ecd120
commit-date: 2022-11-02
host: x86_64-apple-darwin
release: 1.65.0
LLVM version: 15.0.0
Backtrace

n/a

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

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.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions