diff --git a/components/rendering/tests/markdown.rs b/components/rendering/tests/markdown.rs index 3b1c6499..e37f9212 100644 --- a/components/rendering/tests/markdown.rs +++ b/components/rendering/tests/markdown.rs @@ -937,7 +937,7 @@ Bla bla"#;
Bla bla
"#; - tera.add_raw_template(&format!("shortcodes/{}.md", "quote"), shortcode).unwrap(); + tera.add_raw_template("shortcodes/quote.md", shortcode).unwrap(); let config = Config::default(); let context = RenderContext::new(&tera, &config, "", &permalinks_ctx, InsertAnchor::None); @@ -1003,3 +1003,36 @@ fn can_render_commented_out_shortcodes_fine() { let res = render_content(markdown_string, &context).unwrap(); assert_eq!(res.body, expected); } + + +// https://zola.discourse.group/t/zola-12-issue-with-continue-reading/590/7 +#[test] +fn can_render_read_more_after_shortcode() { + let permalinks_ctx = HashMap::new(); + let mut tera = Tera::default(); + tera.extend(&ZOLA_TERA).unwrap(); + + let shortcode = r#"Quote: {{body}}
"#; + let markdown_string = r#" +# Title + +Some text +{{ quote(body="Nothing is impossible. The word itself says - I'm Possible" author="Audrey Hepburn")}} + + +Again more text"#; + + let expected = r#"Some text
+Quote: Nothing is impossible. The word itself says - I'm Possible
+ +Again more text
+"#; + + tera.add_raw_template("shortcodes/quote.md", shortcode).unwrap(); + let config = Config::default(); + let context = RenderContext::new(&tera, &config, "", &permalinks_ctx, InsertAnchor::None); + + let res = render_content(markdown_string, &context).unwrap(); + assert_eq!(res.body, expected); +}