From b774273653d721b2124edacdb83e6f654cfca7a7 Mon Sep 17 00:00:00 2001 From: Reilly Tucker Siemens Date: Sun, 29 Oct 2017 12:55:36 -0700 Subject: [PATCH] Minimal test to reproduce issue #160 --- components/rendering/tests/markdown.rs | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/components/rendering/tests/markdown.rs b/components/rendering/tests/markdown.rs index e7687bc1c..96275ba67 100644 --- a/components/rendering/tests/markdown.rs +++ b/components/rendering/tests/markdown.rs @@ -137,6 +137,33 @@ fn can_render_body_shortcode_with_markdown_char_in_name() { } } +#[test] +fn can_render_body_shortcode_and_paragraph_after() { + let permalinks_ctx = HashMap::new(); + let mut tera = Tera::default(); + tera.extend(&GUTENBERG_TERA).unwrap(); + + let shortcode = "

{{ body }}

"; + let markdown_string = r#" +{% figure() %} +This is a figure caption. +{% end %} + +Here is another paragraph. +"#; + + let expected = "

This is a figure caption.

+

Here is another paragraph.

+"; + + tera.add_raw_template(&format!("shortcodes/{}.html", "figure"), shortcode).unwrap(); + let context = Context::new(&tera, true, "base16-ocean-dark".to_string(), "", &permalinks_ctx, InsertAnchor::None); + + let res = markdown_to_html(markdown_string, &context).unwrap(); + println!("{:?}", res); + assert_eq!(res.0, expected); +} + #[test] fn can_render_several_shortcode_in_row() { let permalinks_ctx = HashMap::new();