diff --git a/src/render.rs b/src/render.rs index 3b7fb8d198..9e1623efa1 100644 --- a/src/render.rs +++ b/src/render.rs @@ -391,6 +391,7 @@ mod tests { let absolute = "[hi](/hi)"; let relative = "[there](there)"; let image = "![alt](img.png)"; + let html_image = "\"alt\""; let svg = "![alt](sanitize.svg)"; for host in &["github.com", "gitlab.com", "bitbucket.org"] { @@ -429,6 +430,15 @@ mod tests { ) ); + let result = markdown_to_html(html_image, Some(&url)); + assert_eq!( + result, + format!( + "\"alt\"\n", + host + ) + ); + let result = markdown_to_html(svg, Some(&url)); assert_eq!( result, @@ -520,4 +530,15 @@ mod tests { "

foo-bar

\n
Hello World!
\n" ); } + + #[test] + fn image_alignment() { + let text = + "\"\"\n"; + let result = markdown_to_html(text, None); + assert_eq!( + result, + "\"\"\n" + ); + } }