Skip to content

doc attribute doesn't behave like rustc does #442

@TheKK

Description

@TheKK

Inputs

#[no_mangle]
#[doc = "a \n b"]
pub extern "C" fn example_a() {}

and

#[no_mangle]
#[doc = "a \n\n b"]
pub extern "C" fn example_b() {}

Rendered rustdoc

rustdoc/the doc attribute

圖片

圖片

Actual generated header

///a
 b
void example_a();
///a

 b
void example_b();

Expected generated header

///a b
void example_a();
///a
///
///b
void example_b();

This happens when I'm trying to generate multi-line comments with macro. Looks like (code) we simply use value in single doc attribute directly without any modification (like rustdoc does).

BTW, I'm happy to help this out :)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions