From b4256dc2e1352a2b74f29b2650150cc8b57f54ed Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Thu, 8 Sep 2022 15:46:46 +0200 Subject: Add support for mdx jsx (flow) --- src/compiler.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/compiler.rs') diff --git a/src/compiler.rs b/src/compiler.rs index 572cc4e..e878c09 100644 --- a/src/compiler.rs +++ b/src/compiler.rs @@ -365,6 +365,7 @@ fn enter(context: &mut CompileContext) { | Name::HeadingSetextText | Name::Label | Name::MdxJsxTextTag + | Name::MdxJsxFlowTag | Name::ReferenceString | Name::ResourceTitleString => on_enter_buffer(context), @@ -468,6 +469,7 @@ fn exit(context: &mut CompileContext) { Name::ListOrdered | Name::ListUnordered => on_exit_list(context), Name::ListItem => on_exit_list_item(context), Name::ListItemValue => on_exit_list_item_value(context), + Name::MdxJsxFlowTag => on_exit_mdx_jsx_flow_tag(context), Name::Paragraph => on_exit_paragraph(context), Name::ReferenceString => on_exit_reference_string(context), Name::ResourceDestinationString => on_exit_resource_destination_string(context), @@ -1674,6 +1676,12 @@ fn on_exit_media(context: &mut CompileContext) { } } +/// Handle [`Exit`][Kind::Exit]:[`MdxJsxFlowTag`][Name::MdxJsxFlowTag]. +fn on_exit_mdx_jsx_flow_tag(context: &mut CompileContext) { + context.resume(); + context.slurp_one_line_ending = true; +} + /// Handle [`Exit`][Kind::Exit]:[`Paragraph`][Name::Paragraph]. fn on_exit_paragraph(context: &mut CompileContext) { let tight = context.tight_stack.last().unwrap_or(&false); -- cgit