Expand description
HTML and XML escaping.
Winged-Swift has three distinct escapers and the golden fixtures depend on the
differences between them. WINGED_RUST_SPEC.md §3.3 shows only one; following the
spec here would break parity.
| function | escapes | notes |
|---|---|---|
escape_text | & < > " ' | & first; ' becomes ' |
escape_attribute | & " ' | not < or > |
escape_xml | & < > " ' | ' becomes ', the XML spelling |
Escaping is applied once, when content enters the tree — never at render time.
That mirrors Winged-Swift, where HTMLTag.init stores already-escaped content, and it
is why crate::core::Node::Raw exists as the documented escape hatch.
Functions§
- escape_
attribute - Escapes a value for use inside a double-quoted HTML attribute.
- escape_
text - Escapes text for use as HTML element content.
- escape_
text_ with_ slashes - Escapes text for HTML content, optionally escaping
/as well. - escape_
xml - Escapes text for XML content — used by the sitemap and RSS generators.