Skip to content

Commit 0e76b2a

Browse files
committed
feat: add test cases
Signed-off-by: K.B.Dharun Krishna <[email protected]>
1 parent 027aacf commit 0e76b2a

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

crates/crates_io_markdown/lib.rs

+26
Original file line numberDiff line numberDiff line change
@@ -672,4 +672,30 @@ There can also be some text in between!
672672
</picture>
673673
"#);
674674
}
675+
676+
#[test]
677+
fn markdown_alerts() {
678+
let text = "> [!note]\n> Something of note";
679+
assert_snapshot!(markdown_to_html(text, None, ""), @r#"
680+
<div class="markdown-alert markdown-alert-note">
681+
<p class="markdown-alert-title">Note</p>
682+
<p>Something of note</p>
683+
</div>
684+
"#);
685+
}
686+
687+
#[test]
688+
fn markdown_multiline_block_quotes_complex() {
689+
let text = "Paragraph one\n\n>>>\nParagraph two\n\n- one\n- two\n>>>";
690+
assert_snapshot!(markdown_to_html(text, None, ""), @r#"
691+
<p>Paragraph one</p>
692+
<blockquote>
693+
<p>Paragraph two</p>
694+
<ul>
695+
<li>one</li>
696+
<li>two</li>
697+
</ul>
698+
</blockquote>
699+
"#);
700+
}
675701
}

tests/acceptance/readme-rendering-test.js

+16
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,22 @@ graph TD;
6666
C-->D;
6767
</code></pre>
6868
69+
<h3>GitHub Style Alert</h3>
70+
<div class="markdown-alert markdown-alert-note">
71+
<p class="markdown-alert-title">Note</p>
72+
<p>Something of note</p>
73+
</div>
74+
75+
<h3>GitLab Style Multiline Block Quotes</h3>
76+
<p>Paragraph one</p>
77+
<blockquote>
78+
<p>Paragraph two</p>
79+
<ul>
80+
<li>one</li>
81+
<li>two</li>
82+
</ul>
83+
</blockquote>
84+
6985
<ul>
7086
<li>
7187
<p>Delegate to a method with a different name</p>

0 commit comments

Comments
 (0)