diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-09-09 15:42:07 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-09-09 15:42:07 +0200 |
commit | 4711b1f0720eb54e458ca5a16cb655013693b628 (patch) | |
tree | de911aa4fee2a8e97104b30b3435c1f17af30140 /tests/mdx_jsx_flow.rs | |
parent | 118cc91fd56a9b4c93bec5b1cb4c5f25924d353e (diff) | |
download | markdown-rs-4711b1f0720eb54e458ca5a16cb655013693b628.tar.gz markdown-rs-4711b1f0720eb54e458ca5a16cb655013693b628.tar.bz2 markdown-rs-4711b1f0720eb54e458ca5a16cb655013693b628.zip |
Add support for mdx attribute (value) expressions
Diffstat (limited to 'tests/mdx_jsx_flow.rs')
-rw-r--r-- | tests/mdx_jsx_flow.rs | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/tests/mdx_jsx_flow.rs b/tests/mdx_jsx_flow.rs index ff53dcb..9b0453f 100644 --- a/tests/mdx_jsx_flow.rs +++ b/tests/mdx_jsx_flow.rs @@ -33,12 +33,11 @@ fn mdx_jsx_flow_agnostic() -> Result<(), String> { "should support an element w/ containers as content" ); - // To do: expressions. - // assert_eq!( - // micromark_with_options("<a b c:d e=\"\" f={/* g */} {...h} />", &mdx)?, - // "", - // "should support attributes" - // ); + assert_eq!( + micromark_with_options("<a b c:d e=\"\" f={/* g */} {...h} />", &mdx)?, + "", + "should support attributes" + ); Ok(()) } @@ -97,7 +96,7 @@ fn mdx_jsx_flow_essence() -> Result<(), String> { ); assert_eq!( - micromark_with_options("> <a b='\nc'/> d", &mdx) + micromark_with_options("> <a b='\nc'/>", &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", @@ -105,7 +104,7 @@ fn mdx_jsx_flow_essence() -> Result<(), String> { ); assert_eq!( - micromark_with_options("> <a b='c\n'/> d", &mdx) + micromark_with_options("> <a b='c\n'/>", &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", @@ -113,7 +112,7 @@ fn mdx_jsx_flow_essence() -> Result<(), String> { ); assert_eq!( - micromark_with_options("> <a b='c\nd'/> e", &mdx) + micromark_with_options("> <a b='c\nd'/>", &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", @@ -121,9 +120,25 @@ fn mdx_jsx_flow_essence() -> Result<(), String> { ); assert_eq!( + micromark_with_options("> <a b={c\nd}/>", &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", + "should not support lazy flow (5)" + ); + + assert_eq!( + micromark_with_options("> <a {b\nc}/>", &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", + "should not support lazy flow (6)" + ); + + assert_eq!( micromark_with_options("> a\n<X />", &mdx)?, "<blockquote>\n<p>a</p>\n</blockquote>\n", - "should not support lazy flow (5)" + "should not support lazy flow (7)" ); Ok(()) |