From ec2d1bfb4232178fb3a6cba36f138bc6efbbf34a Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Thu, 13 Oct 2022 10:40:01 +0200 Subject: Rename crate to `markdown` --- tests/misc_dangerous_protocol.rs | 66 ++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 33 deletions(-) (limited to 'tests/misc_dangerous_protocol.rs') diff --git a/tests/misc_dangerous_protocol.rs b/tests/misc_dangerous_protocol.rs index 0c25eba..1703d60 100644 --- a/tests/misc_dangerous_protocol.rs +++ b/tests/misc_dangerous_protocol.rs @@ -1,35 +1,35 @@ -extern crate micromark; -use micromark::micromark; +extern crate markdown; +use markdown::to_html; use pretty_assertions::assert_eq; #[test] fn dangerous_protocol_autolink() { assert_eq!( - micromark(""), + to_html(""), "

javascript:alert(1)

", "should be safe by default" ); assert_eq!( - micromark(""), + to_html(""), "

http://a

", "should allow `http:`" ); assert_eq!( - micromark(""), + to_html(""), "

https://a

", "should allow `https:`" ); assert_eq!( - micromark(""), + to_html(""), "

irc:///help

", "should allow `irc:`" ); assert_eq!( - micromark(""), + to_html(""), "

mailto:a

", "should allow `mailto:`" ); @@ -38,79 +38,79 @@ fn dangerous_protocol_autolink() { #[test] fn dangerous_protocol_image() { assert_eq!( - micromark("![](javascript:alert(1))"), + to_html("![](javascript:alert(1))"), "

\"\"

", "should be safe by default" ); assert_eq!( - micromark("![](http://a)"), + to_html("![](http://a)"), "

\"\"

", "should allow `http:`" ); assert_eq!( - micromark("![](https://a)"), + to_html("![](https://a)"), "

\"\"

", "should allow `https:`" ); assert_eq!( - micromark("![](irc:///help)"), + to_html("![](irc:///help)"), "

\"\"

", "should not allow `irc:`" ); assert_eq!( - micromark("![](mailto:a)"), + to_html("![](mailto:a)"), "

\"\"

", "should not allow `mailto:`" ); assert_eq!( - micromark("![](#a)"), + to_html("![](#a)"), "

\"\"

", "should allow a hash" ); assert_eq!( - micromark("![](?a)"), + to_html("![](?a)"), "

\"\"

", "should allow a search" ); assert_eq!( - micromark("![](/a)"), + to_html("![](/a)"), "

\"\"

", "should allow an absolute" ); assert_eq!( - micromark("![](./a)"), + to_html("![](./a)"), "

\"\"

", "should allow an relative" ); assert_eq!( - micromark("![](../a)"), + to_html("![](../a)"), "

\"\"

", "should allow an upwards relative" ); assert_eq!( - micromark("![](a#b:c)"), + to_html("![](a#b:c)"), "

\"\"

", "should allow a colon in a hash" ); assert_eq!( - micromark("![](a?b:c)"), + to_html("![](a?b:c)"), "

\"\"

", "should allow a colon in a search" ); assert_eq!( - micromark("![](a/b:c)"), + to_html("![](a/b:c)"), "

\"\"

", "should allow a colon in a path" ); @@ -119,79 +119,79 @@ fn dangerous_protocol_image() { #[test] fn dangerous_protocol_link() { assert_eq!( - micromark("[](javascript:alert(1))"), + to_html("[](javascript:alert(1))"), "

", "should be safe by default" ); assert_eq!( - micromark("[](http://a)"), + to_html("[](http://a)"), "

", "should allow `http:`" ); assert_eq!( - micromark("[](https://a)"), + to_html("[](https://a)"), "

", "should allow `https:`" ); assert_eq!( - micromark("[](irc:///help)"), + to_html("[](irc:///help)"), "

", "should allow `irc:`" ); assert_eq!( - micromark("[](mailto:a)"), + to_html("[](mailto:a)"), "

", "should allow `mailto:`" ); assert_eq!( - micromark("[](#a)"), + to_html("[](#a)"), "

", "should allow a hash" ); assert_eq!( - micromark("[](?a)"), + to_html("[](?a)"), "

", "should allow a search" ); assert_eq!( - micromark("[](/a)"), + to_html("[](/a)"), "

", "should allow an absolute" ); assert_eq!( - micromark("[](./a)"), + to_html("[](./a)"), "

", "should allow an relative" ); assert_eq!( - micromark("[](../a)"), + to_html("[](../a)"), "

", "should allow an upwards relative" ); assert_eq!( - micromark("[](a#b:c)"), + to_html("[](a#b:c)"), "

", "should allow a colon in a hash" ); assert_eq!( - micromark("[](a?b:c)"), + to_html("[](a?b:c)"), "

", "should allow a colon in a search" ); assert_eq!( - micromark("[](a/b:c)"), + to_html("[](a/b:c)"), "

", "should allow a colon in a path" ); -- cgit