Skip to content

Commit

Permalink
fix: shortcode in inline elements
Browse files Browse the repository at this point in the history
  • Loading branch information
amtanq committed Aug 7, 2024
1 parent 88bd972 commit 66b3d7a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion components/markdown/src/markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand Down
9 changes: 9 additions & 0 deletions components/markdown/tests/shortcodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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#"<a href="{{ out_put_id(id="top") }}">top</a>"#
).unwrap().body;
insta::assert_snapshot!(body);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
source: components/markdown/tests/shortcodes.rs
assertion_line: 321
expression: body
---
<p><a href="top">top</a></p>

0 comments on commit 66b3d7a

Please sign in to comment.