oxidoc-highlight 0.1.1

Lightweight syntax highlighting for documentation engines
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
/// Append HTML-escaped version of `s` to `out`.
pub fn escape_html(s: &str, out: &mut String) {
    for c in s.chars() {
        match c {
            '&' => out.push_str("&"),
            '<' => out.push_str("&lt;"),
            '>' => out.push_str("&gt;"),
            '"' => out.push_str("&quot;"),
            _ => out.push(c),
        }
    }
}