Skip to main content

leading_prose_from_attrs

Function leading_prose_from_attrs 

Source
fn leading_prose_from_attrs(attrs: &[Attribute]) -> Option<String>
Expand description

Collect the leading prose of a doc comment (all paragraphs before the first @tag) as roxygen @description text, with rustdoc intra-doc links neutralized.

Each /// line is one doc attribute; a blank line is an empty attribute and marks a paragraph boundary. Paragraphs are joined with "\n\n" so push_roxygen_tags renders blank #' lines between them — roxygen2 multi-paragraph description text.

Returns None when the block has no leading prose (empty, or starts with a @tag), so tag-led blocks never gain a spurious @description.