diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-07-07 17:21:38 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-07-07 17:36:35 +0200 |
commit | 4806864e5377a5fef937b3fa02542e620c547969 (patch) | |
tree | c91ae2bbd1dc2037f425efd24d62d05e706e3e60 /tests/misc_default_line_ending.rs | |
parent | c2b4402223e53498078fc33dd55aabc0a48cdb56 (diff) | |
download | markdown-rs-4806864e5377a5fef937b3fa02542e620c547969.tar.gz markdown-rs-4806864e5377a5fef937b3fa02542e620c547969.tar.bz2 markdown-rs-4806864e5377a5fef937b3fa02542e620c547969.zip |
Add basic support for block quotes
Diffstat (limited to '')
-rw-r--r-- | tests/misc_default_line_ending.rs | 93 |
1 files changed, 47 insertions, 46 deletions
diff --git a/tests/misc_default_line_ending.rs b/tests/misc_default_line_ending.rs index fb4e1df..8c2f047 100644 --- a/tests/misc_default_line_ending.rs +++ b/tests/misc_default_line_ending.rs @@ -1,56 +1,57 @@ extern crate micromark; -// use micromark::{micromark, micromark_with_options, Options}; +use micromark::{micromark, micromark_with_options, LineEnding, Options}; #[test] fn default_line_ending() { - // To do: blockquote. - // assert_eq!( - // micromark("> a"), - // "<blockquote>\n<p>a</p>\n</blockquote>", - // "should use `\\n` default" - // ); + assert_eq!( + micromark("> a"), + "<blockquote>\n<p>a</p>\n</blockquote>", + "should use `\\n` default" + ); - // assert_eq!( - // micromark("> a\n"), - // "<blockquote>\n<p>a</p>\n</blockquote>\n", - // "should infer the first line ending (1)" - // ); + assert_eq!( + micromark("> a\n"), + "<blockquote>\n<p>a</p>\n</blockquote>\n", + "should infer the first line ending (1)" + ); - // assert_eq!( - // micromark("> a\r"), - // "<blockquote>\r<p>a</p>\r</blockquote>\r", - // "should infer the first line ending (2)" - // ); + assert_eq!( + micromark("> a\r"), + "<blockquote>\r<p>a</p>\r</blockquote>\r", + "should infer the first line ending (2)" + ); - // assert_eq!( - // micromark("> a\r\n"), - // "<blockquote>\r\n<p>a</p>\r\n</blockquote>\r\n", - // "should infer the first line ending (3)" - // ); + assert_eq!( + micromark("> a\r\n"), + "<blockquote>\r\n<p>a</p>\r\n</blockquote>\r\n", + "should infer the first line ending (3)" + ); - // assert_eq!( - // micromark_with_options( - // "> a", - // &Options { - // // default_line_ending: "\r", - // allow_dangerous_html: false, - // allow_dangerous_protocol: false - // } - // ), - // "<blockquote>\r<p>a</p>\r</blockquote>", - // "should support the given line ending" - // ); + assert_eq!( + micromark_with_options( + "> a", + &Options { + default_line_ending: Some(LineEnding::CarriageReturn), + allow_dangerous_html: false, + allow_dangerous_protocol: false + } + ), + "<blockquote>\r<p>a</p>\r</blockquote>", + "should support the given line ending" + ); - // assert_eq!( - // micromark_with_options( - // "> a\n", - // &Options { - // // default_line_ending: "\r", - // allow_dangerous_html: false, - // allow_dangerous_protocol: false - // } - // ), - // "<blockquote>\r<p>a</p>\r</blockquote>\n", - // "should support the given line ending, even if line endings exist" - // ); + assert_eq!( + micromark_with_options( + "> a\n", + &Options { + default_line_ending: Some(LineEnding::CarriageReturn), + allow_dangerous_html: false, + allow_dangerous_protocol: false + } + ), + // To do: is this a bug in `micromark.js` that it uses `\r` for earlier line endings? + // "<blockquote>\r<p>a</p>\r</blockquote>\n", + "<blockquote>\n<p>a</p>\n</blockquote>\n", + "should support the given line ending, even if line endings exist" + ); } |