Skip to content

Commit

Permalink
config: Don't skip extra syntax loading if highlight_theme = css (#1732)
Browse files Browse the repository at this point in the history
Currently, init_extra_syntaxtes_and_highlight_themes will supress
loading anything if highlight_theme is "css". This makes sense for the
highlight themes, but will also skip loading any extra syntax
definitions too.

This change defers the theme = css check, so we still load syntaxes in
this case.

Fixes: #1723

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
  • Loading branch information
jk-ozlabs authored and Keats committed Jan 23, 2022
1 parent 684bc2d commit 1b20aca
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions components/config/src/config/markup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,17 @@ impl Markdown {
}

pub fn init_extra_syntaxes_and_highlight_themes(&mut self, path: &Path) -> Result<()> {
if self.highlight_theme == "css" {
return Ok(());
}

let (loaded_extra_syntaxes, loaded_extra_highlight_themes) =
self.load_extra_syntaxes_and_highlight_themes(path)?;

if let Some(extra_syntax_set) = loaded_extra_syntaxes {
self.extra_syntax_set = Some(extra_syntax_set);
}

if self.highlight_theme == "css" {
return Ok(());
}

if let Some(extra_theme_set) = loaded_extra_highlight_themes {
self.extra_theme_set = Arc::new(Some(extra_theme_set));
}
Expand Down

0 comments on commit 1b20aca

Please sign in to comment.