diff --git a/components/rendering/tests/markdown.rs b/components/rendering/tests/markdown.rs index a3969513..a383450c 100644 --- a/components/rendering/tests/markdown.rs +++ b/components/rendering/tests/markdown.rs @@ -563,3 +563,20 @@ fn can_show_error_message_for_invalid_external_links() { let err = res.unwrap_err(); assert!(err.description().contains("Link http://google.comy is not valid")); } + +#[test] +fn can_handle_summaries() { + let tera_ctx = Tera::default(); + let permalinks_ctx = HashMap::new(); + let config = Config::default(); + let context = RenderContext::new(&tera_ctx, &config, "", &permalinks_ctx, Path::new("something"), InsertAnchor::None); + let res = render_content("Hello [world]\n\n\n\nBla bla\n\n[world]: https://vincent.is/about/", &context).unwrap(); + assert_eq!( + res.body, + "
Hello world
\n\nBla bla
\n" + ); + assert_eq!( + res.summary_len, + Some("Hello world
\n".len()) + ); +}