pub fn escape_attribute(input: &str) -> StringExpand description
Escapes a value for use inside a double-quoted HTML attribute.
Deliberately narrower than escape_text: < and > are left alone, because they
cannot terminate a quoted attribute value. Winged-Swift’s HTMLEscape.escapeAttribute
does the same, and marketing-pretty.html contains attribute values that prove it.
§Examples
use winged_rust::core::escape::escape_attribute;
assert_eq!(escape_attribute(r#"a "b" & <c>"#), "a "b" & <c>");