Expand description
Manage xml character escapes
Enums§
- Escape
Error - Error for XML escape / unescape.
- Parse
Char RefError - Error of parsing character reference (
&#<dec-number>;
or&#x<hex-number>;
).
Functions§
- escape
- Escapes an
&str
and replaces all xml special characters (<
,>
,&
,'
,"
) with their corresponding xml escaped value. - minimal_
escape - 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. - partial_
escape - Escapes an
&str
and replaces xml special characters (<
,>
,&
) with their corresponding xml escaped value. - resolve_
html5_ entity escape-html
- Resolves all HTML5 entities. For complete list see https://dev.w3.org/html5/html-author/charref.
- resolve_
predefined_ entity - Resolves predefined XML entities or all HTML5 entities depending on the feature
escape-html
. - resolve_
xml_ entity - Resolves predefined XML entities. If specified entity is not a predefined XML
entity,
None
is returned. - unescape
- Unescape an
&str
and replaces all xml escaped characters (&...;
) into their corresponding value. - unescape_
with - Unescape an
&str
and replaces all xml escaped characters (&...;
) into their corresponding value, using a resolver function for custom entities.