glentities/html_encoder

Functions

pub fn encode(text: String) -> String

Encode text to be safe in the HTML body, inside element or attribute content.

&, <, >, ', and " are encoded.

Note! Not suitable for outputting inside <style>, <script> elements.

Search Document