From 5403261e8213f68633a09fc3e9bc2e6e2cd777b2 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Mon, 18 Jul 2022 16:31:14 +0200 Subject: Add support for turning off constructs --- tests/link_resource.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'tests/link_resource.rs') diff --git a/tests/link_resource.rs b/tests/link_resource.rs index 31e4b81..7f48fb1 100644 --- a/tests/link_resource.rs +++ b/tests/link_resource.rs @@ -1,14 +1,14 @@ extern crate micromark; use micromark::{micromark, micromark_with_options, Options}; -const DANGER: &Options = &Options { - allow_dangerous_html: true, - allow_dangerous_protocol: true, - default_line_ending: None, -}; - #[test] fn link_resource() { + let danger = Options { + allow_dangerous_html: true, + allow_dangerous_protocol: true, + ..Options::default() + }; + assert_eq!( micromark("[link](/uri \"title\")"), "

link

", @@ -52,7 +52,7 @@ fn link_resource() { ); assert_eq!( - micromark_with_options("[link]()", DANGER), + micromark_with_options("[link]()", &danger), "

[link]()

", "should not support links w/ line endings in enclosed destination" ); @@ -70,7 +70,7 @@ fn link_resource() { ); assert_eq!( - micromark_with_options("[a](\n[a](c)", DANGER), + micromark_with_options("[a](\n[a](c)", &danger), "

[a](<b)c\n[a](<b)c>\n[a](c)

", "should not support links w/ unmatched enclosed destinations" ); @@ -100,7 +100,7 @@ fn link_resource() { ); assert_eq!( - micromark_with_options("[link](foo\\)\\:)", DANGER), + micromark_with_options("[link](foo\\)\\:)", &danger), "

link

", "should support links w/ escapes in destinations" ); @@ -274,7 +274,7 @@ fn link_resource() { ); assert_eq!( - micromark_with_options("[foo ", DANGER), + micromark_with_options("[foo ", &danger), "

[foo

", "should prefer HTML over links" ); @@ -312,7 +312,7 @@ fn link_resource() { ); assert_eq!( - micromark_with_options("[a](\"c\")", DANGER), + micromark_with_options("[a](\"c\")", &danger), "

[a]("c")

", "should require whitespace between enclosed destination and title" ); -- cgit