Function escape_html

Source
pub fn escape_html(output: &mut String, text: &str)
Expand description

Escape special HTML characters in a string

§Arguments

  • output - The string buffer to write to
  • text - The text to escape

§Example

let mut output = String::new();
pulldown_html_ext::utils::escape_html(&mut output, "<div>test</div>");
assert_eq!(output, "&lt;div&gt;test&lt;/div&gt;");