diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-09-08 15:46:46 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-09-08 16:30:56 +0200 |
commit | b4256dc2e1352a2b74f29b2650150cc8b57f54ed (patch) | |
tree | 67ddb1b3c99be459fd0fa1ea19b5f89565e56b65 /src/compiler.rs | |
parent | 2d24336c61e88e364e63e36db7b0803bc6532159 (diff) | |
download | markdown-rs-b4256dc2e1352a2b74f29b2650150cc8b57f54ed.tar.gz markdown-rs-b4256dc2e1352a2b74f29b2650150cc8b57f54ed.tar.bz2 markdown-rs-b4256dc2e1352a2b74f29b2650150cc8b57f54ed.zip |
Add support for mdx jsx (flow)
Diffstat (limited to 'src/compiler.rs')
-rw-r--r-- | src/compiler.rs | 8 |
1 files changed, 8 insertions, 0 deletions
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); |