diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-10-13 10:40:01 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-10-13 10:40:01 +0200 |
commit | ec2d1bfb4232178fb3a6cba36f138bc6efbbf34a (patch) | |
tree | 2da4be3be22c2324c48cb17133b3f4b26b9139d2 /tests/gfm_strikethrough.rs | |
parent | 861af95c119721e814460fa7dc32bd3d74b38484 (diff) | |
download | markdown-rs-ec2d1bfb4232178fb3a6cba36f138bc6efbbf34a.tar.gz markdown-rs-ec2d1bfb4232178fb3a6cba36f138bc6efbbf34a.tar.bz2 markdown-rs-ec2d1bfb4232178fb3a6cba36f138bc6efbbf34a.zip |
Rename crate to `markdown`
Diffstat (limited to 'tests/gfm_strikethrough.rs')
-rw-r--r-- | tests/gfm_strikethrough.rs | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/tests/gfm_strikethrough.rs b/tests/gfm_strikethrough.rs index 6109814..980f1e9 100644 --- a/tests/gfm_strikethrough.rs +++ b/tests/gfm_strikethrough.rs @@ -1,7 +1,7 @@ -extern crate micromark; -use micromark::{ +extern crate markdown; +use markdown::{ mdast::{Delete, Node, Paragraph, Root, Text}, - micromark, micromark_to_mdast, micromark_with_options, + to_html, to_html_with_options, to_mdast, unist::Position, Constructs, Options, ParseOptions, }; @@ -18,61 +18,61 @@ fn gfm_strikethrough() -> Result<(), String> { }; assert_eq!( - micromark("a ~b~ c"), + to_html("a ~b~ c"), "<p>a ~b~ c</p>", "should ignore strikethrough by default" ); assert_eq!( - micromark_with_options("a ~b~", &gfm)?, + to_html_with_options("a ~b~", &gfm)?, "<p>a <del>b</del></p>", "should support strikethrough w/ one tilde" ); assert_eq!( - micromark_with_options("a ~~b~~", &gfm)?, + to_html_with_options("a ~~b~~", &gfm)?, "<p>a <del>b</del></p>", "should support strikethrough w/ two tildes" ); assert_eq!( - micromark_with_options("a ~~~b~~~", &gfm)?, + to_html_with_options("a ~~~b~~~", &gfm)?, "<p>a ~~~b~~~</p>", "should not support strikethrough w/ three tildes" ); assert_eq!( - micromark_with_options("a \\~~~b~~ c", &gfm)?, + to_html_with_options("a \\~~~b~~ c", &gfm)?, "<p>a ~<del>b</del> c</p>", "should support strikethrough after an escaped tilde" ); assert_eq!( - micromark_with_options("a ~~b ~~c~~ d~~ e", &gfm)?, + to_html_with_options("a ~~b ~~c~~ d~~ e", &gfm)?, "<p>a <del>b <del>c</del> d</del> e</p>", "should support nested strikethrough" ); assert_eq!( - micromark_with_options("a ~-1~ b", &gfm)?, + to_html_with_options("a ~-1~ b", &gfm)?, "<p>a <del>-1</del> b</p>", "should open if preceded by whitespace and followed by punctuation" ); assert_eq!( - micromark_with_options("a ~b.~ c", &gfm)?, + to_html_with_options("a ~b.~ c", &gfm)?, "<p>a <del>b.</del> c</p>", "should close if preceded by punctuation and followed by whitespace" ); assert_eq!( - micromark_with_options("~b.~.", &gfm)?, + to_html_with_options("~b.~.", &gfm)?, "<p><del>b.</del>.</p>", "should close if preceded and followed by punctuation" ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" # Balanced @@ -165,7 +165,7 @@ a ~~two b two~~ c one~ d ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" # Flank @@ -222,7 +222,7 @@ a ~~twoLeft b ~~twoLeft c ~~twoLeft d ); assert_eq!( - micromark_with_options( + to_html_with_options( r###" # Interlpay @@ -368,7 +368,7 @@ u ~**xxx**~ zzz ); assert_eq!( - micromark_with_options( + to_html_with_options( "a ~b~ ~~c~~ d", &Options { parse: ParseOptions { @@ -384,7 +384,7 @@ u ~**xxx**~ zzz ); assert_eq!( - micromark_with_options( + to_html_with_options( "a ~b~ ~~c~~ d", &Options { parse: ParseOptions { @@ -400,7 +400,7 @@ u ~**xxx**~ zzz ); assert_eq!( - micromark_to_mdast("a ~~alpha~~ b.", &gfm.parse)?, + to_mdast("a ~~alpha~~ b.", &gfm.parse)?, Node::Root(Root { children: vec![Node::Paragraph(Paragraph { children: vec![ |