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/hard_break_escape.rs | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'tests/hard_break_escape.rs') diff --git a/tests/hard_break_escape.rs b/tests/hard_break_escape.rs index a486ade..1f93429 100644 --- a/tests/hard_break_escape.rs +++ b/tests/hard_break_escape.rs @@ -1,5 +1,5 @@ extern crate micromark; -use micromark::micromark; +use micromark::{micromark, micromark_with_options, Constructs, Options}; #[test] fn hard_break_escape() { @@ -39,10 +39,18 @@ fn hard_break_escape() { "should not support escape hard breaks at the end of a heading" ); - // // To do: turning things off. - // assert_eq!( - // micromark("a\\\nb", {extensions: [{disable: {null: ["hardBreakEscape"]}}]}), - // "

a\\\nb

", - // "should support turning off hard break (escape)" - // ); + assert_eq!( + micromark_with_options( + "a\\\nb", + &Options { + constructs: Constructs { + hard_break_escape: false, + ..Constructs::default() + }, + ..Options::default() + } + ), + "

a\\\nb

", + "should support turning off hard break (escape)" + ); } -- cgit