[][src]Function html_escape::encode_unquoted_attribute

pub fn encode_unquoted_attribute<S: ?Sized + AsRef<str>>(text: &S) -> Cow<str>

Encode text used in an unquoted attribute. Except for alphanumeric characters, escape all characters which are less than 128.

The following characters are escaped to named entities:

  • & => &amp;
  • < => &lt;
  • > => &gt;
  • " => &quot;

Other non-alphanumeric characters are escaped to &#xHH;.