quick_xml::escape

Function minimal_escape

Source
pub fn minimal_escape<'a>(raw: impl Into<Cow<'a, str>>) -> Cow<'a, str>
Expand description

XML standard requires that only < and & was escaped in text content or attribute value. All other characters not necessary to be escaped, although for compatibility with SGML they also should be escaped. Practically, escaping only those characters is enough.

This function performs following replacements:

CharacterReplacement
<&lt;
&&amp;