Skip to content

Commit

Permalink
Minimal test to reproduce issue #160
Browse files Browse the repository at this point in the history
  • Loading branch information
reillysiemens committed Oct 29, 2017
1 parent bfdfe3b commit b774273
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions components/rendering/tests/markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "<p>{{ body }}</p>";
let markdown_string = r#"
{% figure() %}
This is a figure caption.
{% end %}
Here is another paragraph.
"#;

let expected = "<p>This is a figure caption.</p>
<p>Here is another paragraph.</p>
";

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();
Expand Down

0 comments on commit b774273

Please sign in to comment.