Skip to content

Commit

Permalink
Fix highlighting
Browse files Browse the repository at this point in the history
Closes #1291
  • Loading branch information
Keats committed Jan 7, 2021
1 parent 3b074c1 commit aa03a7f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions components/config/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ pub struct Config {
translations: HashMap<String, languages::TranslateTerm>,

/// Whether to highlight all code blocks found in markdown files. Defaults to false
pub highlight_code: bool,
highlight_code: bool,
/// Which themes to use for code highlighting. See Readme for supported themes
/// Defaults to "base16-ocean-dark"
pub highlight_theme: String,
highlight_theme: String,

/// Whether to generate a feed. Defaults to false.
pub generate_feed: bool,
Expand Down
2 changes: 1 addition & 1 deletion components/config/src/highlighting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ lazy_static! {

/// Returns the highlighter and whether it was found in the extra or not
pub fn get_highlighter(language: Option<&str>, config: &Config) -> (HighlightLines<'static>, bool) {
let theme = &THEME_SET.themes[&config.highlight_theme];
let theme = &THEME_SET.themes[config.highlight_theme()];
let mut in_extra = false;

if let Some(ref lang) = language {
Expand Down
2 changes: 1 addition & 1 deletion components/rendering/src/markdown/codeblock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub struct CodeBlock<'config> {
impl<'config> CodeBlock<'config> {
pub fn new(fence_info: &str, config: &'config Config, background: IncludeBackground) -> Self {
let fence_info = FenceSettings::new(fence_info);
let theme = &THEME_SET.themes[&config.highlight_theme];
let theme = &THEME_SET.themes[config.highlight_theme()];
let (highlighter, in_extra) = get_highlighter(fence_info.language, config);
Self {
highlighter,
Expand Down

0 comments on commit aa03a7f

Please sign in to comment.