Debian Codegraph @

src/tests/compact_html.rs

raw
1 use super::*;
2
3 #[test]
4 fn compact_paragraph() {
5 html_opts!(
6 [render.compact_html],
7 "Hello world.\n",
8 "<p>Hello world.</p>",
9 );
10 }
11
12 #[test]
13 fn compact_multiple_paragraphs() {
14 html_opts!(
15 [render.compact_html],
16 "Paragraph one.\n\nParagraph two.\n",
17 "<p>Paragraph one.</p><p>Paragraph two.</p>",
18 );
19 }
20
21 #[test]
22 fn compact_heading() {
23 html_opts!(
24 [render.compact_html],
25 "# Hello\n\nWorld.\n",
26 "<h1>Hello</h1><p>World.</p>",
27 );
28 }
29
30 #[test]
31 fn compact_list() {
32 html_opts!(
33 [render.compact_html],
34 "- one\n- two\n- three\n",
35 "<ul><li>one</li><li>two</li><li>three</li></ul>",
36 );
37 }
38
39 #[test]
40 fn compact_ordered_list() {
41 html_opts!(
42 [render.compact_html],
43 "1. one\n2. two\n3. three\n",
44 "<ol><li>one</li><li>two</li><li>three</li></ol>",
45 );
46 }
47
48 #[test]
49 fn compact_blockquote() {
50 html_opts!(
51 [render.compact_html],
52 "> quoted\n",
53 "<blockquote><p>quoted</p></blockquote>",
54 );
55 }
56
57 #[test]
58 fn compact_code_block() {
59 html_opts!(
60 [render.compact_html],
61 "```\nhello\n```\n",
62 "<pre><code>hello\n</code></pre>",
63 );
64 }
65
66 #[test]
67 fn compact_thematic_break() {
68 html_opts!([render.compact_html], "---\n", "<hr />",);
69 }
70
71 #[test]
72 fn compact_table() {
73 html_opts!(
74 [extension.table, render.compact_html],
75 "| a | b |\n|---|---|\n| c | d |\n",
76 "<table><thead><tr><th>a</th><th>b</th></tr></thead><tbody><tr><td>c</td><td>d</td></tr></tbody></table>",
77 );
78 }
79
80 #[test]
81 fn compact_default_off() {
82 html_opts!(
83 [render.compact_html = false],
84 "# Hello\n\nWorld.\n",
85 "<h1>Hello</h1>\n<p>World.</p>\n",
86 );
87 }