summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan-Erik Rediger <janerik@fnordig.de>2021-08-02 18:18:49 +0200
committerJan-Erik Rediger <janerik@fnordig.de>2021-08-02 18:18:49 +0200
commite759070dc8c8d04f452a1c52cc22fd884b6ab0a0 (patch)
treede89e77e60803bbf87720268071f60a579347703
parentb23b9558aba2315d429808d560d6ad692a55418f (diff)
Add test case for backslash escapes
-rw-r--r--tests/backslash_escapes.in.md9
-rw-r--r--tests/backslash_escapes.out.md9
-rw-r--r--tests/it.rs7
3 files changed, 25 insertions, 0 deletions
diff --git a/tests/backslash_escapes.in.md b/tests/backslash_escapes.in.md
new file mode 100644
index 0000000..55fd035
--- /dev/null
+++ b/tests/backslash_escapes.in.md
@@ -0,0 +1,9 @@
+\*not emphasized*
+\<br/> not a tag
+\[not a link](/foo)
+\`not code`
+\* not a list
+\# not a heading
+\[foo]: /url "not a reference"
+\&ouml; not a character entity
+1\. not a list
diff --git a/tests/backslash_escapes.out.md b/tests/backslash_escapes.out.md
new file mode 100644
index 0000000..6be9dec
--- /dev/null
+++ b/tests/backslash_escapes.out.md
@@ -0,0 +1,9 @@
+\*not emphasized\*
+\<br/> not a tag
+\[not a link\](/foo)
+\`not code\`
+\* not a list
+\# not a heading
+\[foo\]: /url "not a reference"
+\&ouml; not a character entity
+1\. not a list
diff --git a/tests/it.rs b/tests/it.rs
index 4c6b350..b0d7e60 100644
--- a/tests/it.rs
+++ b/tests/it.rs
@@ -150,3 +150,10 @@ fn similar_heading_different_casing() {
fn tables_with_html() {
assert_toc!("tables_with_html");
}
+
+#[test]
+fn backslash_escapes() {
+ // Regression test #21
+ // Backslash-escaped elements should still be escaped.
+ assert_toc!("backslash_escapes");
+}