From ec2d1bfb4232178fb3a6cba36f138bc6efbbf34a Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Thu, 13 Oct 2022 10:40:01 +0200 Subject: Rename crate to `markdown` --- tests/mdx_jsx_flow.rs | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'tests/mdx_jsx_flow.rs') diff --git a/tests/mdx_jsx_flow.rs b/tests/mdx_jsx_flow.rs index 5216c82..031d1fd 100644 --- a/tests/mdx_jsx_flow.rs +++ b/tests/mdx_jsx_flow.rs @@ -1,7 +1,7 @@ -extern crate micromark; -use micromark::{ +extern crate markdown; +use markdown::{ mdast::{List, ListItem, MdxJsxFlowElement, Node, Paragraph, Root, Text}, - micromark_to_mdast, micromark_with_options, + to_html_with_options, to_mdast, unist::Position, Constructs, Options, ParseOptions, }; @@ -18,31 +18,31 @@ fn mdx_jsx_flow_agnostic() -> Result<(), String> { }; assert_eq!( - micromark_with_options("", &mdx)?, + to_html_with_options("", &mdx)?, "", "should support a self-closing element" ); assert_eq!( - micromark_with_options("", &mdx)?, + to_html_with_options("", &mdx)?, "", "should support a closed element" ); assert_eq!( - micromark_with_options("\nb\n", &mdx)?, + to_html_with_options("\nb\n", &mdx)?, "

b

\n", "should support an element w/ content" ); assert_eq!( - micromark_with_options("\n- b\n", &mdx)?, + to_html_with_options("\n- b\n", &mdx)?, "\n", "should support an element w/ containers as content" ); assert_eq!( - micromark_with_options("", &mdx)?, + to_html_with_options("", &mdx)?, "", "should support attributes" ); @@ -63,43 +63,43 @@ fn mdx_jsx_flow_essence() -> Result<(), String> { }; assert_eq!( - micromark_with_options("", &mdx)?, + to_html_with_options("", &mdx)?, "", "should support an element" ); assert_eq!( - micromark_with_options("\n- b\n", &mdx)?, + to_html_with_options("\n- b\n", &mdx)?, "\n", "should support an element around a container" ); assert_eq!( - micromark_with_options(" \nb\n ", &mdx)?, + to_html_with_options(" \nb\n ", &mdx)?, "

b

\n", "should support a dangling `>` in a tag (not a block quote)" ); assert_eq!( - micromark_with_options(" \nb\n ", &mdx)?, + to_html_with_options(" \nb\n ", &mdx)?, "

b

\n", "should support trailing initial and final whitespace around tags" ); assert_eq!( - micromark_with_options(" \t\nc\n ", &mdx)?, + to_html_with_options(" \t\nc\n ", &mdx)?, "

c

\n", "should support tags after tags" ); assert_eq!( - micromark_with_options("> ", &mdx).err().unwrap(), + to_html_with_options("> ", &mdx).err().unwrap(), "2:1: Unexpected lazy line in jsx in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc", "should not support lazy flow (1)" ); assert_eq!( - micromark_with_options("> a\n> ", &mdx) + to_html_with_options("> a\n> ", &mdx) .err() .unwrap(), "3:1: Unexpected lazy line in jsx in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc", @@ -107,7 +107,7 @@ fn mdx_jsx_flow_essence() -> Result<(), String> { ); assert_eq!( - micromark_with_options("> ", &mdx) + to_html_with_options("> ", &mdx) .err() .unwrap(), "2:1: Unexpected lazy line in jsx in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc", @@ -115,7 +115,7 @@ fn mdx_jsx_flow_essence() -> Result<(), String> { ); assert_eq!( - micromark_with_options("> ", &mdx) + to_html_with_options("> ", &mdx) .err() .unwrap(), "2:1: Unexpected lazy line in jsx in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc", @@ -123,7 +123,7 @@ fn mdx_jsx_flow_essence() -> Result<(), String> { ); assert_eq!( - micromark_with_options("> ", &mdx) + to_html_with_options("> ", &mdx) .err() .unwrap(), "2:1: Unexpected lazy line in jsx in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc", @@ -131,7 +131,7 @@ fn mdx_jsx_flow_essence() -> Result<(), String> { ); assert_eq!( - micromark_with_options("> ", &mdx) + to_html_with_options("> ", &mdx) .err() .unwrap(), "2:1: Unexpected lazy line in expression in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc", @@ -139,7 +139,7 @@ fn mdx_jsx_flow_essence() -> Result<(), String> { ); assert_eq!( - micromark_with_options("> ", &mdx) + to_html_with_options("> ", &mdx) .err() .unwrap(), "2:1: Unexpected lazy line in expression in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc", @@ -147,13 +147,13 @@ fn mdx_jsx_flow_essence() -> Result<(), String> { ); assert_eq!( - micromark_with_options("> a\n", &mdx)?, + to_html_with_options("> a\n", &mdx)?, "
\n

a

\n
\n", "should not support lazy flow (7)" ); assert_eq!( - micromark_to_mdast("<>\n * a\n", &mdx.parse)?, + to_mdast("<>\n * a\n", &mdx.parse)?, Node::Root(Root { children: vec![Node::MdxJsxFlowElement(MdxJsxFlowElement { name: None, -- cgit