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
This commit is contained in:
parent
8b2b066e64
commit
670b88263c
@ -77,7 +77,7 @@ impl<'config> CodeBlock<'config> {
|
|||||||
path: Option<&'config str>,
|
path: Option<&'config str>,
|
||||||
) -> (Self, String) {
|
) -> (Self, String) {
|
||||||
let syntax_and_theme = resolve_syntax_and_theme(fence.language, config);
|
let syntax_and_theme = resolve_syntax_and_theme(fence.language, config);
|
||||||
if syntax_and_theme.source == HighlightSource::NotFound {
|
if syntax_and_theme.source == HighlightSource::NotFound && config.markdown.highlight_code {
|
||||||
let lang = fence.language.unwrap();
|
let lang = fence.language.unwrap();
|
||||||
if let Some(p) = path {
|
if let Some(p) = path {
|
||||||
eprintln!("Warning: Highlight language {} not found in {}", lang, p);
|
eprintln!("Warning: Highlight language {} not found in {}", lang, p);
|
||||||
|
Loading…
Reference in New Issue
Block a user