1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#[cfg_attr(feature = "nightly", doc = " ```")]
#[cfg_attr(not(feature = "nightly"), doc = " ```ignore")]
pub enum Markdown<'a> {
FromString(&'a str),
}
#[cfg(test)]
mod tests {
#[test]
pub fn test() {
use maud::Render;
use super::Markdown;
let markdown = "
1. A list
2. With some
3. Values
";
let mut buffer = String::new();
Markdown::FromString(markdown).render(&mut buffer).unwrap();
assert_eq!(buffer, "<ol>\n<li>A list</li>\n<li>With some</li>\n<li>Values</li>\n</ol>\n");
}
}