Skip to main content

escape_html

Function escape_html 

Source
pub fn escape_html(text: &str) -> String
Expand description

Escapes the three characters HTML parse_mode treats specially. Per spec §2.2, Telegram’s HTML mode only requires escaping <, >, & — simpler than MarkdownV2. Order matters: & must be escaped first so the escape sequences for </> aren’t themselves re-escaped.