Skip to main content

escape_xml

Function escape_xml 

Source
pub fn escape_xml(input: &str) -> String
Expand description

Escapes text for XML content — used by the sitemap and RSS generators.

Differs from escape_text in one character: ' becomes ', which is an XML entity, rather than '.

§Examples

use winged_rust::core::escape::escape_xml;
assert_eq!(escape_xml("Tom & Jerry's <show>"), "Tom &amp; Jerry&apos;s &lt;show&gt;");