pretext 0.1.0

Native Unicode text preparation and paragraph layout engine for Pretext.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use pretext::analysis::{normalize_whitespace_normal, normalize_whitespace_pre_wrap};

#[test]
fn normal_mode_collapses_ascii_whitespace() {
    assert_eq!(
        normalize_whitespace_normal("  alpha\tbeta\n gamma  "),
        "alpha beta gamma"
    );
}

#[test]
fn pre_wrap_normalizes_crlf_and_cr() {
    assert_eq!(
        normalize_whitespace_pre_wrap("alpha\r\nbeta\rgamma"),
        "alpha\nbeta\ngamma"
    );
}