Skip to content

rustdoc: Markdown headers don't get recognized in certain cases #33771

Closed
@panicbit

Description

@panicbit

#Headers don't seem to get recognized when the header is preceded by some text and a following code block contains hidden lines (///# ...).

Here's a minimal example:

/// Removing this very line makes it render correctly.
///
/// # I will not be rendered correctly
///
/// ```
///# fn foo() {} // A hidden line like this needs to exist
/// ```
pub fn some_item() {}

And this is what it looks like:
rustdoc_bug

I've set up a repository with this example to play around with here: https://github.com/panicbit/rustdoc_bug_33771

cc @Manishearth

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-dev-toolsRelevant to the dev-tools subteam, which will review and decide on the PR/issue.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