Skip to content

rustdoc unexpectedly formatted leading numeral as a list #92005

Closed
@davepacheco

Description

@davepacheco

I have a feeling I'm doing something wrong here so I apologize in advance if this is just noise. But the behavior I'm seeing seems surprising.

I tried this code:

//! 1. One
//!    1. Two
//!
//! This record means: user 123 has the "admin" role on the "project" with id
//! 234.  (Note.)

and I built this with cargo doc.

I expected to see this sentence together in one paragraph: "This record means: user 123 has the "admin" role on the "project" with id 234. (Note.)"

Instead, this happened:

rustdoc

Looking at the HTML, it's interpreted the leading "234." as a numbered list. Thinking this was some Markdown error, I tried it in the dingus but it does what I expected.

Meta

$ cargo version
cargo 1.56.0 (4ed5d137b 2021-10-04)
$ rustdoc --version --verbose
rustdoc 1.56.1 (59eed8a2a 2021-11-01)
binary: rustdoc
commit-hash: 59eed8a2aac0230a8b53e89d4e99d55912ba6b35
commit-date: 2021-11-01
host: x86_64-apple-darwin
release: 1.56.1
LLVM version: 13.0.0

On cargo 1.59.0-nightly (a359ce160 2021-12-14), I see almost the same behavior, but the "2" in 234 gets eaten:

rustdoc-nightly

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-markdown-parsingArea: Markdown parsing for doc-commentsC-bugCategory: This is a bug.P-mediumMedium priorityT-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