mobot 0.3.10

A Telegram framework for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/// Test that markdown text is properly escaped.

#[test]
fn escape_code() {
    let code = "hello `world` \\foo";

    assert_eq!(mobot::api::escape_code(code), "hello \\`world\\` \\\\foo");
}

#[test]
fn escape_markdown() {
    let md = "hello *world* [foo](bar) _baz_";

    assert_eq!(
        mobot::api::escape_md(md),
        "hello \\*world\\* \\[foo\\]\\(bar\\) \\_baz\\_"
    );
}