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/heading_atx.rs | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'tests/heading_atx.rs') diff --git a/tests/heading_atx.rs b/tests/heading_atx.rs index 530ddc5..22c9f82 100644 --- a/tests/heading_atx.rs +++ b/tests/heading_atx.rs @@ -1,5 +1,5 @@ extern crate micromark; -use micromark::micromark; +use micromark::{micromark, micromark_with_options, Constructs, Options}; #[test] fn heading_atx() { assert_eq!( @@ -194,10 +194,18 @@ fn heading_atx() { "should not support lazyness (2)" ); - // To do: turning things off: - // assert_eq!( - // micromark("# a", {extensions: [{disable: {null: ["headingAtx"]}}]}), - // "

# a

", - // "should support turning off heading (atx)" - // ); + assert_eq!( + micromark_with_options( + "# a", + &Options { + constructs: Constructs { + heading_atx: false, + ..Constructs::default() + }, + ..Options::default() + } + ), + "

# a

", + "should support turning off heading (atx)" + ); } -- cgit