From e759070dc8c8d04f452a1c52cc22fd884b6ab0a0 Mon Sep 17 00:00:00 2001 From: Jan-Erik Rediger Date: Mon, 2 Aug 2021 18:18:49 +0200 Subject: [PATCH] Add test case for backslash escapes --- tests/backslash_escapes.in.md | 9 +++++++++ tests/backslash_escapes.out.md | 9 +++++++++ tests/it.rs | 7 +++++++ 3 files changed, 25 insertions(+) create mode 100644 tests/backslash_escapes.in.md create mode 100644 tests/backslash_escapes.out.md 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* +\
not a tag +\[not a link](/foo) +\`not code` +\* not a list +\# not a heading +\[foo]: /url "not a reference" +\ö 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\* +\
not a tag +\[not a link\](/foo) +\`not code\` +\* not a list +\# not a heading +\[foo\]: /url "not a reference" +\ö 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"); +}