diff --git a/components/rendering/src/markdown.rs b/components/rendering/src/markdown.rs index ba8edfa1..9111e2ce 100644 --- a/components/rendering/src/markdown.rs +++ b/components/rendering/src/markdown.rs @@ -231,7 +231,9 @@ pub fn markdown_to_html(content: &str, context: &RenderContext) -> Result"); + Event::Html(html.into()) } Event::End(Tag::CodeBlock(_)) => { if !context.config.highlight_code { @@ -239,7 +241,7 @@ pub fn markdown_to_html(content: &str, context: &RenderContext) -> Result".into()) + Event::Html("".into()) } Event::Start(Tag::Image(link_type, src, title)) => { if is_colocated_asset_link(&src) { diff --git a/components/rendering/tests/markdown.rs b/components/rendering/tests/markdown.rs index 93172be1..e3d48c92 100644 --- a/components/rendering/tests/markdown.rs +++ b/components/rendering/tests/markdown.rs @@ -39,7 +39,7 @@ fn can_highlight_code_block_no_lang() { let res = render_content("```\n$ gutenberg server\n$ ping\n```", &context).unwrap(); assert_eq!( res.body, - "
\n$ gutenberg server\n$ ping\n
" + "
\n$ gutenberg server\n$ ping\n
" ); } @@ -53,7 +53,7 @@ fn can_highlight_code_block_with_lang() { let res = render_content("```python\nlist.append(1)\n```", &context).unwrap(); assert_eq!( res.body, - "
\nlist.append(1)\n
" + "
\nlist.append(1)\n
" ); } @@ -68,7 +68,7 @@ fn can_higlight_code_block_with_unknown_lang() { // defaults to plain text assert_eq!( res.body, - "
\nlist.append(1)\n
" + "
\nlist.append(1)\n
" ); }