diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-09-07 15:53:06 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-09-07 15:53:06 +0200 |
commit | 1d92666865b35341e076efbefddf6e73b5e1542e (patch) | |
tree | 11c05985ec7679f73473e7ea2c769465698e2f08 /tests/character_reference.rs | |
parent | e6018e52ee6ad9a8f8a0672b75bf515faf74af1f (diff) | |
download | markdown-rs-1d92666865b35341e076efbefddf6e73b5e1542e.tar.gz markdown-rs-1d92666865b35341e076efbefddf6e73b5e1542e.tar.bz2 markdown-rs-1d92666865b35341e076efbefddf6e73b5e1542e.zip |
Add support for recoverable syntax errors
Diffstat (limited to 'tests/character_reference.rs')
-rw-r--r-- | tests/character_reference.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/character_reference.rs b/tests/character_reference.rs index c388514..a08c3f9 100644 --- a/tests/character_reference.rs +++ b/tests/character_reference.rs @@ -3,11 +3,10 @@ use micromark::{micromark, micromark_with_options, Constructs, Options}; use pretty_assertions::assert_eq; #[test] -fn character_reference() { +fn character_reference() -> Result<(), String> { assert_eq!( micromark( - " & © Æ Ď\n¾ ℋ ⅆ\n∲ ≧̸" - ), + " & © Æ Ď\n¾ ℋ ⅆ\n∲ ≧̸"), "<p>\u{a0} & © Æ Ď\n¾ ℋ ⅆ\n∲ ≧̸</p>", "should support named character references" ); @@ -26,8 +25,7 @@ fn character_reference() { assert_eq!( micromark( - "  &x; &#; &#x;\n�\n&#abcdef0;\n&ThisIsNotDefined; &hi?;" - ), + "  &x; &#; &#x;\n�\n&#abcdef0;\n&ThisIsNotDefined; &hi?;"), "<p>&nbsp &x; &#; &#x;\n&#987654321;\n&#abcdef0;\n&ThisIsNotDefined; &hi?;</p>", "should not support other things that look like character references" ); @@ -51,7 +49,7 @@ fn character_reference() { allow_dangerous_html: true, ..Options::default() } - ), + )?, "<a href=\"öö.html\">", "should not care about character references in html" ); @@ -199,8 +197,10 @@ fn character_reference() { }, ..Options::default() } - ), + )?, "<p>&amp;</p>", "should support turning off character references" ); + + Ok(()) } |