diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-10-06 15:57:55 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-10-06 15:57:55 +0200 |
commit | cd5bb2d16c6b28332b0b6077b27b2b90a8051896 (patch) | |
tree | 848ebc6200b80d2dfdcd67bf0bb245eea06bb24f /tests/gfm_strikethrough.rs | |
parent | 6e80e03bb6d6af47aba2b339f160e4895ab5afba (diff) | |
download | markdown-rs-cd5bb2d16c6b28332b0b6077b27b2b90a8051896.tar.gz markdown-rs-cd5bb2d16c6b28332b0b6077b27b2b90a8051896.tar.bz2 markdown-rs-cd5bb2d16c6b28332b0b6077b27b2b90a8051896.zip |
Refactor to split parse from compile options
Diffstat (limited to '')
-rw-r--r-- | tests/gfm_strikethrough.rs | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/tests/gfm_strikethrough.rs b/tests/gfm_strikethrough.rs index e392700..ac6b62c 100644 --- a/tests/gfm_strikethrough.rs +++ b/tests/gfm_strikethrough.rs @@ -3,14 +3,17 @@ use micromark::{ mdast::{Delete, Node, Paragraph, Root, Text}, micromark, micromark_to_mdast, micromark_with_options, unist::Position, - Constructs, Options, + Constructs, Options, ParseOptions, }; use pretty_assertions::assert_eq; #[test] fn gfm_strikethrough() -> Result<(), String> { let gfm = Options { - constructs: Constructs::gfm(), + parse: ParseOptions { + constructs: Constructs::gfm(), + ..ParseOptions::default() + }, ..Options::default() }; @@ -368,8 +371,11 @@ u ~**xxx**~ zzz micromark_with_options( "a ~b~ ~~c~~ d", &Options { - constructs: Constructs::gfm(), - gfm_strikethrough_single_tilde: false, + parse: ParseOptions { + constructs: Constructs::gfm(), + gfm_strikethrough_single_tilde: false, + ..ParseOptions::default() + }, ..Options::default() } )?, @@ -381,8 +387,11 @@ u ~**xxx**~ zzz micromark_with_options( "a ~b~ ~~c~~ d", &Options { - constructs: Constructs::gfm(), - gfm_strikethrough_single_tilde: true, + parse: ParseOptions { + constructs: Constructs::gfm(), + gfm_strikethrough_single_tilde: true, + ..ParseOptions::default() + }, ..Options::default() } )?, @@ -391,7 +400,7 @@ u ~**xxx**~ zzz ); assert_eq!( - micromark_to_mdast("a ~~alpha~~ b.", &gfm)?, + micromark_to_mdast("a ~~alpha~~ b.", &gfm.parse)?, Node::Root(Root { children: vec![Node::Paragraph(Paragraph { children: vec![ |