pub fn escape_attribute(value: &str) -> StringExpand description
Escapes a value for use inside a double-quoted HTML attribute.
&, <, > and " are replaced; an apostrophe is left alone because
it cannot terminate a double-quoted attribute, which keeps rendered
meta tags readable.
ยงExample
use metadata_gen::escape_attribute;
assert_eq!(
escape_attribute(r#"Fish & "Chips" <it's>"#),
"Fish & "Chips" <it's>"
);