aboutsummaryrefslogtreecommitdiffstats
path: root/tests/misc_default_line_ending.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-06-21 12:06:51 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-06-21 12:06:51 +0200
commitf99d131ec3ab60956344d001bcd40244343c241b (patch)
treeac798f9a6a1ab73021cdd5a5303e20424d37172e /tests/misc_default_line_ending.rs
parent182467c1d393dee2081ff80f1c049cb145f23123 (diff)
downloadmarkdown-rs-f99d131ec3ab60956344d001bcd40244343c241b.tar.gz
markdown-rs-f99d131ec3ab60956344d001bcd40244343c241b.tar.bz2
markdown-rs-f99d131ec3ab60956344d001bcd40244343c241b.zip
Add support for inferring line ending, configurable
* Rename `CompileOptions` to `Options` * Add support for an optional default line ending style * Add support for inferring the used line ending style
Diffstat (limited to '')
-rw-r--r--tests/misc_default_line_ending.rs56
1 files changed, 56 insertions, 0 deletions
diff --git a/tests/misc_default_line_ending.rs b/tests/misc_default_line_ending.rs
new file mode 100644
index 0000000..fb4e1df
--- /dev/null
+++ b/tests/misc_default_line_ending.rs
@@ -0,0 +1,56 @@
+extern crate micromark;
+// use micromark::{micromark, micromark_with_options, 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\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\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\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"
+ // );
+}