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. Also escapes \r which would otherwise be
converted to \n by XML end-of-line normalization.
This function performs following replacements:
| Character | Replacement |
|---|---|
< | < |
& | & |
\r | |