From c790a943ab4cbb5eefa8704f017eb3cf070bf860 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Thu, 13 Oct 2022 19:02:21 +0200 Subject: Add test for mdx and indented code --- tests/mdx_jsx_flow.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tests/mdx_jsx_flow.rs') diff --git a/tests/mdx_jsx_flow.rs b/tests/mdx_jsx_flow.rs index 031d1fd..b2fdf30 100644 --- a/tests/mdx_jsx_flow.rs +++ b/tests/mdx_jsx_flow.rs @@ -23,6 +23,25 @@ fn mdx_jsx_flow_agnostic() -> Result<(), String> { "should support a self-closing element" ); + // Note: in MDX, indented code is turned off: + assert_eq!( + to_html_with_options( + " ", + &Options { + parse: ParseOptions { + constructs: Constructs { + mdx_jsx_flow: true, + ..Constructs::default() + }, + ..ParseOptions::default() + }, + ..Options::default() + } + )?, + "
<a />\n
", + "should prefer indented code over jsx if it’s enabled" + ); + assert_eq!( to_html_with_options("
", &mdx)?, "", -- cgit