Skip to content

Commit 670b882

Browse files
welpoKeats
authored andcommitted
fix: suppress highlight language warnings if highlight_code is false (#2287)
The warning about unknown highlight languages was displayed even when code highlighting was disabled via `markdown.highlight_code = false`. This commit adds a condition to check this setting before issuing the warning, effectively suppressing it when code highlighting is disabled. Issue: #2280
1 parent 8b2b066 commit 670b882

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • components/markdown/src/codeblock

components/markdown/src/codeblock/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ impl<'config> CodeBlock<'config> {
7777
path: Option<&'config str>,
7878
) -> (Self, String) {
7979
let syntax_and_theme = resolve_syntax_and_theme(fence.language, config);
80-
if syntax_and_theme.source == HighlightSource::NotFound {
80+
if syntax_and_theme.source == HighlightSource::NotFound && config.markdown.highlight_code {
8181
let lang = fence.language.unwrap();
8282
if let Some(p) = path {
8383
eprintln!("Warning: Highlight language {} not found in {}", lang, p);

0 commit comments

Comments
 (0)