calepin 0.0.17

A Rust CLI for preprocessing Typst documents with executable code chunks
1
2
3
4
5
6
7
8
9
/// Escape the five characters that are unsafe in HTML text and double-quoted
/// attribute values.
pub fn escape(value: &str) -> String {
    value
        .replace('&', "&")
        .replace('<', "&lt;")
        .replace('>', "&gt;")
        .replace('"', "&quot;")
}