Skip to content

Newlines don't cause a paragraph break when mixing #[doc] and /// #91201

Closed
@camelid

Description

@camelid

See the test added in #91199. This code:

#[doc = "Hello world!\n\n"]
/// Goodbye!
#[doc = "  Hello again!\n"]
pub struct S1;

renders as:

Hello world! Goodbye! Hello again!

rather than the expected:

Hello world!

Goodbye! Hello again!

Meanwhile, changing some #[doc]s to ///s and vice versa causes it to render as expected.

cc @GuillaumeGomez

Metadata

Metadata

Labels

A-attributesArea: Attributes (`#[…]`, `#![…]`)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