diff --git a/components/rendering/src/markdown.rs b/components/rendering/src/markdown.rs index e7468db..9a9095b 100644 --- a/components/rendering/src/markdown.rs +++ b/components/rendering/src/markdown.rs @@ -51,6 +51,7 @@ pub fn markdown_to_html(content: &str, context: &RenderContext) -> Result = None; // If we get text in header, we need to insert the id and a anchor let mut in_header = false; @@ -93,7 +94,7 @@ pub fn markdown_to_html(content: &str, context: &RenderContext) -> Result Result highlighter = Some(h), + Ok(h) => { + highlighter = Some(h); + // This selects the background color the same way that start_coloured_html_snippet does + let color = theme.settings.background.unwrap_or(::syntect::highlighting::Color::WHITE); + background = IncludeBackground::IfDifferent(color); + } Err(err) => { error = Some(format!("Could not load syntax: {}", err).into()); return Event::Html(Borrowed(""));