aboutsummaryrefslogtreecommitdiffstats
path: root/tests/misc_dangerous_protocol.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/misc_dangerous_protocol.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/misc_dangerous_protocol.rs')
-rw-r--r--tests/misc_dangerous_protocol.rs12
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/misc_dangerous_protocol.rs b/tests/misc_dangerous_protocol.rs
index 0c25eba..88058f2 100644
--- a/tests/misc_dangerous_protocol.rs
+++ b/tests/misc_dangerous_protocol.rs
@@ -3,7 +3,7 @@ use micromark::micromark;
use pretty_assertions::assert_eq;
#[test]
-fn dangerous_protocol_autolink() {
+fn dangerous_protocol_autolink() -> Result<(), String> {
assert_eq!(
micromark("<javascript:alert(1)>"),
"<p><a href=\"\">javascript:alert(1)</a></p>",
@@ -33,10 +33,12 @@ fn dangerous_protocol_autolink() {
"<p><a href=\"mailto:a\">mailto:a</a></p>",
"should allow `mailto:`"
);
+
+ Ok(())
}
#[test]
-fn dangerous_protocol_image() {
+fn dangerous_protocol_image() -> Result<(), String> {
assert_eq!(
micromark("![](javascript:alert(1))"),
"<p><img src=\"\" alt=\"\" /></p>",
@@ -114,10 +116,12 @@ fn dangerous_protocol_image() {
"<p><img src=\"a/b:c\" alt=\"\" /></p>",
"should allow a colon in a path"
);
+
+ Ok(())
}
#[test]
-fn dangerous_protocol_link() {
+fn dangerous_protocol_link() -> Result<(), String> {
assert_eq!(
micromark("[](javascript:alert(1))"),
"<p><a href=\"\"></a></p>",
@@ -195,4 +199,6 @@ fn dangerous_protocol_link() {
"<p><a href=\"a/b:c\"></a></p>",
"should allow a colon in a path"
);
+
+ Ok(())
}