calepin 0.0.51

A Rust CLI for preprocessing Typst documents with executable code chunks
1
2
3
4
5
6
7
8
9
10
11
12
use crate::utils::html::escape as html_escape;

pub(super) fn xml_escape(value: &str) -> String {
    html_escape(value).replace('\'', "'")
}

pub(super) fn clean_optional_string(value: Option<&str>) -> Option<String> {
    value
        .map(str::trim)
        .filter(|value| !value.is_empty())
        .map(str::to_string)
}