diff --git a/components/markdown/src/markdown.rs b/components/markdown/src/markdown.rs index a8565176c8..e31fc53dd6 100644 --- a/components/markdown/src/markdown.rs +++ b/components/markdown/src/markdown.rs @@ -679,7 +679,7 @@ pub fn markdown_to_html( event }); } - Event::Html(text) => { + Event::Html(text) | Event::InlineHtml(text) => { if !has_summary && MORE_DIVIDER_RE.is_match(&text) { has_summary = true; events.push(Event::Html(CONTINUE_READING.into())); diff --git a/components/markdown/tests/shortcodes.rs b/components/markdown/tests/shortcodes.rs index a99a199d6d..e5cd36b91c 100644 --- a/components/markdown/tests/shortcodes.rs +++ b/components/markdown/tests/shortcodes.rs @@ -311,3 +311,12 @@ fn can_use_shortcodes_in_quotes() { .body; insta::assert_snapshot!(body); } + +// https://github.com/getzola/zola/issues/2565 +#[test] +fn can_use_shortcodes_in_inline_elements() { + let body = common::render( + r#"top"# + ).unwrap().body; + insta::assert_snapshot!(body); +} diff --git a/components/markdown/tests/snapshots/shortcodes__can_use_shortcodes_in_inline_elements.snap b/components/markdown/tests/snapshots/shortcodes__can_use_shortcodes_in_inline_elements.snap new file mode 100644 index 0000000000..bb226f7fd5 --- /dev/null +++ b/components/markdown/tests/snapshots/shortcodes__can_use_shortcodes_in_inline_elements.snap @@ -0,0 +1,6 @@ +--- +source: components/markdown/tests/shortcodes.rs +assertion_line: 321 +expression: body +--- +