fn attribute(i: &str) -> IResult<&str, StyleAttribute, VerboseError<&str>> {
        #[cfg(test)]
        trace!("Attribute: {}", i);

        Self::expect_non_empty(i)?;

        let result = context(
            "StyleAttribute",
            Self::trimmed(map(
                separated_pair(
                    // Key
                    Self::style_attr_key,
                    // Separator
                    tag(":"),
                    Self::style_attr_value,
                ),
                move |p: (&str, StringFragment)| StyleAttribute {
                    key: p.0.trim().to_string().into(),
                    value: vec![p.1].into(),
                },
            )),
        )(i);

        #[cfg(test)]
        trace!("Attribute: {:#?}", result);

        result
    }
/// Parse a style attribute such as "width: 10px"
Parse a style attribute such as "width: 10px"
Parse a style attribute such as " width : 10px "
fn attribute(i: &str) -> IResult<&str, StyleAttribute, VerboseError<&str>> {
        #[cfg(test)]
        trace!("Attribute: {}", i);
        Self::expect_non_empty(i)?;
        let result = context(
            "StyleAttribute",
            Self::trimmed(map(
                separated_pair(
                    // Key
                    Self::style_attr_key,
                    // Separator
                    tag(":"),
                    Self::style_attr_value,
                ),
                move |p: (&str, StringFragment)| StyleAttribute {
                    key: p.0.trim().to_string().into(),
                    value: vec![p.1].into(),
                },
            )),
        )(i);
        #[cfg(test)]
        trace!("Attribute: {:#?}", result);
        result
    }
fn attribute ( i : & str ) -> IResult < & str , StyleAttribute , VerboseError < & str > > { # [ cfg ( test ) ] trace ! ( " " i ) ; Self :: expect_non_empty ( i ) ? ; let result = context ( " " , Self :: trimmed ( map ( separated_pair ( // Key Self :: style_attr_key , // Separator tag ( " " ) , Self :: style_attr_value , ) , move | p : ( & str , StringFragment ) | StyleAttribute { key : p . 0 . trim ( ) . to_string ( ) . into ( ) , value : vec ! [ p 1 ] . into ( ) , } , ) ) , ) ( i ) ; # [ cfg ( test ) ] trace ! ( " " result ) ; result }
Parse a style attribute such as "width: 10px"
Parse a style attribute such as " width : 10px "
i
&str
i
&str