Function xml5ever::serialize::write_to_buf_escaped

source ยท
fn write_to_buf_escaped<W: Write>(
    writer: &mut W,
    text: &str,
    attr_mode: bool,
) -> Result<()>
Expand description

Writes given text into the Serializer, escaping it, depending on where the text is written inside the tag or attribute value.

For example

    <tag>'&-quotes'</tag>   becomes      <tag>'&amp;-quotes'</tag>
    <tag = "'&-quotes'">    becomes      <tag = "&apos;&amp;-quotes&apos;"