Skip to main content

parse_attrs

Function parse_attrs 

Source
pub fn parse_attrs(input: &str) -> Result<Attrs, ParseError>
Expand description

Parse a SurfDoc attribute string into an ordered map.

Accepted formats:

  • [key=value key2="quoted with spaces" flag num=42]
  • key=value key2="quoted" (without brackets)

Boolean flags (bare keys without =) are stored as AttrValue::Bool(true). Numeric values are stored as AttrValue::Number. Everything else is AttrValue::String.