pub(crate) fn strip_roxygen_from_attrs(attrs: &[Attribute]) -> Vec<Attribute>Expand description
Strip roxygen tag lines from doc attributes, keeping only regular documentation.
Returns a new vector of attributes with roxygen lines removed from doc comments. Non-doc attributes are passed through unchanged.
§Algorithm
Roxygen tags typically appear at the end of documentation blocks. We use a simple but effective approach:
- Keep all content before the first
@tagline - Strip everything from the first
@tagto the end of the roxygen region
A roxygen region ends when we see a non-empty line that doesn’t start with @
and follows an empty line (paragraph break). This handles multi-paragraph tags.