aboutsummaryrefslogtreecommitdiffstats
path: root/tests/character_reference.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-09-07 15:53:06 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-09-07 15:53:06 +0200
commit1d92666865b35341e076efbefddf6e73b5e1542e (patch)
tree11c05985ec7679f73473e7ea2c769465698e2f08 /tests/character_reference.rs
parente6018e52ee6ad9a8f8a0672b75bf515faf74af1f (diff)
downloadmarkdown-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.rs14
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(
- "&nbsp; &amp; &copy; &AElig; &Dcaron;\n&frac34; &HilbertSpace; &DifferentialD;\n&ClockwiseContourIntegral; &ngE;"
- ),
+ "&nbsp; &amp; &copy; &AElig; &Dcaron;\n&frac34; &HilbertSpace; &DifferentialD;\n&ClockwiseContourIntegral; &ngE;"),
"<p>\u{a0} &amp; © Æ Ď\n¾ ℋ ⅆ\n∲ ≧̸</p>",
"should support named character references"
);
@@ -26,8 +25,7 @@ fn character_reference() {
assert_eq!(
micromark(
- "&nbsp &x; &#; &#x;\n&#987654321;\n&#abcdef0;\n&ThisIsNotDefined; &hi?;"
- ),
+ "&nbsp &x; &#; &#x;\n&#987654321;\n&#abcdef0;\n&ThisIsNotDefined; &hi?;"),
"<p>&amp;nbsp &amp;x; &amp;#; &amp;#x;\n&amp;#987654321;\n&amp;#abcdef0;\n&amp;ThisIsNotDefined; &amp;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=\"&ouml;&ouml;.html\">",
"should not care about character references in html"
);
@@ -199,8 +197,10 @@ fn character_reference() {
},
..Options::default()
}
- ),
+ )?,
"<p>&amp;amp;</p>",
"should support turning off character references"
);
+
+ Ok(())
}