Function html_escape::encode_script

source ·
pub fn encode_script<S: ?Sized + AsRef<str>>(text: &S) -> Cow<'_, str>
Expand description

Encode text used in the <script> element.

The following substring is escaped:

  • </script> => <\/script>
  • <!-- => <\!--