Skip to main content

convert_text_to_hashiverse_html

Function convert_text_to_hashiverse_html 

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

Converts a plain-text post into well-formed HTML that submit_post() can parse.

  • HTML-escapes <, >, &, " in the input to prevent injection
  • Converts #hashtag patterns into <hashtag hashtag="..."> elements
  • Converts @<64-hex-char-id> patterns into <mention client_id="..."> elements
  • Converts newlines into <br> tags