Skip to content

Commit c02d57c

Browse files
committed
don't warn of language is empty
1 parent 20bc8b7 commit c02d57c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Elastic.Markdown/Myst/CodeBlocks/EnhancedCodeBlockParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public override bool Close(BlockProcessor processor, Block block)
8787
"terminal" => "bash",
8888
_ => codeBlock.Language
8989
};
90-
if (!CodeBlock.Languages.Contains(codeBlock.Language))
90+
if (!string.IsNullOrEmpty(codeBlock.Language) && !CodeBlock.Languages.Contains(codeBlock.Language))
9191
codeBlock.EmitWarning($"Unknown language: {codeBlock.Language}");
9292

9393
var lines = codeBlock.Lines;

src/Elastic.Markdown/Myst/CodeBlocks/SupportedLanguages.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public static class CodeBlock
182182
};
183183

184184

185-
public static HashSet<string> Languages => new HashSet<string>(
185+
public static HashSet<string> Languages => new(
186186
LanguageMapping.Keys
187187
.Concat(LanguageMapping.Values
188188
.SelectMany(v => v.Split(',').Select(a => a.Trim()))

0 commit comments

Comments
 (0)