pub fn escape(text: &str) -> StringExpand description
Escape text for an element body or an attribute value. The five characters that can leave either context are replaced; nothing else is touched, so UTF-8 stays UTF-8.
use majordomus_cli::cockpit::html::escape;
assert_eq!(escape("<script>&\"'"), "<script>&"'");
assert_eq!(escape("příkaz"), "příkaz");