diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-09-09 13:17:59 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-09-09 13:17:59 +0200 |
commit | 118cc91fd56a9b4c93bec5b1cb4c5f25924d353e (patch) | |
tree | 3a33911c5b3f7da33919dfb48f1a0b8f8b46bb1b /src/state.rs | |
parent | ffef323d3c927f84e94cae21afeb541be7320f1c (diff) | |
download | markdown-rs-118cc91fd56a9b4c93bec5b1cb4c5f25924d353e.tar.gz markdown-rs-118cc91fd56a9b4c93bec5b1cb4c5f25924d353e.tar.bz2 markdown-rs-118cc91fd56a9b4c93bec5b1cb4c5f25924d353e.zip |
Add mdx expression (flow, text)
Diffstat (limited to 'src/state.rs')
-rw-r--r-- | src/state.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/state.rs b/src/state.rs index db03a90..2158966 100644 --- a/src/state.rs +++ b/src/state.rs @@ -150,6 +150,7 @@ pub enum Name { FlowBeforeCodeIndented, FlowBeforeRaw, FlowBeforeHtml, + FlowBeforeMdxExpression, FlowBeforeMdxJsx, FlowBeforeHeadingAtx, FlowBeforeHeadingSetext, @@ -434,12 +435,38 @@ pub enum Name { TitleAtBlankLine, TitleEscape, TitleInside, + + MdxExpressionTextStart, + MdxExpressionTextAfter, + + MdxExpressionFlowStart, + MdxExpressionFlowBefore, + MdxExpressionFlowAfter, + MdxExpressionFlowEnd, + + MdxExpressionStart, + MdxExpressionBefore, + MdxExpressionInside, + MdxExpressionEolAfter, } #[allow(clippy::too_many_lines)] /// Call the corresponding state for a state name. pub fn call(tokenizer: &mut Tokenizer, name: Name) -> State { let func = match name { + Name::MdxExpressionTextStart => construct::mdx_expression_text::start, + Name::MdxExpressionTextAfter => construct::mdx_expression_text::after, + + Name::MdxExpressionFlowStart => construct::mdx_expression_flow::start, + Name::MdxExpressionFlowBefore => construct::mdx_expression_flow::before, + Name::MdxExpressionFlowAfter => construct::mdx_expression_flow::after, + Name::MdxExpressionFlowEnd => construct::mdx_expression_flow::end, + + Name::MdxExpressionStart => construct::partial_mdx_expression::start, + Name::MdxExpressionBefore => construct::partial_mdx_expression::before, + Name::MdxExpressionInside => construct::partial_mdx_expression::inside, + Name::MdxExpressionEolAfter => construct::partial_mdx_expression::eol_after, + Name::AttentionStart => construct::attention::start, Name::AttentionInside => construct::attention::inside, @@ -555,6 +582,7 @@ pub fn call(tokenizer: &mut Tokenizer, name: Name) -> State { Name::FlowBeforeCodeIndented => construct::flow::before_code_indented, Name::FlowBeforeRaw => construct::flow::before_raw, Name::FlowBeforeHtml => construct::flow::before_html, + Name::FlowBeforeMdxExpression => construct::flow::before_mdx_expression, Name::FlowBeforeMdxJsx => construct::flow::before_mdx_jsx, Name::FlowBeforeHeadingAtx => construct::flow::before_heading_atx, Name::FlowBeforeHeadingSetext => construct::flow::before_heading_setext, |