diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-07-18 16:31:14 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-07-18 16:31:14 +0200 |
commit | 5403261e8213f68633a09fc3e9bc2e6e2cd777b2 (patch) | |
tree | bb3a6419ef42f7611c2cb24fe7024228f579331b /tests/misc_line_ending.rs | |
parent | 03544cafaa82ba4bd7e0bc3372fc59549a8dc0cc (diff) | |
download | markdown-rs-5403261e8213f68633a09fc3e9bc2e6e2cd777b2.tar.gz markdown-rs-5403261e8213f68633a09fc3e9bc2e6e2cd777b2.tar.bz2 markdown-rs-5403261e8213f68633a09fc3e9bc2e6e2cd777b2.zip |
Add support for turning off constructs
Diffstat (limited to 'tests/misc_line_ending.rs')
-rw-r--r-- | tests/misc_line_ending.rs | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/tests/misc_line_ending.rs b/tests/misc_line_ending.rs index 195ddaa..f6dbccd 100644 --- a/tests/misc_line_ending.rs +++ b/tests/misc_line_ending.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 line_ending() { + let danger = &Options { + allow_dangerous_html: true, + allow_dangerous_protocol: true, + ..Options::default() + }; + assert_eq!( micromark("a\nb"), "<p>a\nb</p>", @@ -106,55 +106,55 @@ fn line_ending() { ); assert_eq!( - micromark_with_options("<div\n", DANGER), + micromark_with_options("<div\n", danger), "<div\n", "should support a line feed after html" ); assert_eq!( - micromark_with_options("<div\r", DANGER), + micromark_with_options("<div\r", danger), "<div\r", "should support a carriage return after html" ); assert_eq!( - micromark_with_options("<div\r\n", DANGER), + micromark_with_options("<div\r\n", danger), "<div\r\n", "should support a carriage return + line feed after html" ); assert_eq!( - micromark_with_options("<div>\n\nx", DANGER), + micromark_with_options("<div>\n\nx", danger), "<div>\n<p>x</p>", "should support a blank line w/ line feeds after html" ); assert_eq!( - micromark_with_options("<div>\r\rx", DANGER), + micromark_with_options("<div>\r\rx", danger), "<div>\r<p>x</p>", "should support a blank line w/ carriage returns after html" ); assert_eq!( - micromark_with_options("<div>\r\n\r\nx", DANGER), + micromark_with_options("<div>\r\n\r\nx", danger), "<div>\r\n<p>x</p>", "should support a blank line w/ carriage return + line feeds after html" ); assert_eq!( - micromark_with_options("<div>\nx", DANGER), + micromark_with_options("<div>\nx", danger), "<div>\nx", "should support a non-blank line w/ line feed in html" ); assert_eq!( - micromark_with_options("<div>\rx", DANGER), + micromark_with_options("<div>\rx", danger), "<div>\rx", "should support a non-blank line w/ carriage return in html" ); assert_eq!( - micromark_with_options("<div>\r\nx", DANGER), + micromark_with_options("<div>\r\nx", danger), "<div>\r\nx", "should support a non-blank line w/ carriage return + line feed in html" ); |