diff --git a/Program.cs b/Program.cs index f8e80b8..127b34a 100644 --- a/Program.cs +++ b/Program.cs @@ -23,7 +23,7 @@ var xrefRegex = new Regex("", RegexOptions.Compiled); var langwordXrefRegex = new Regex("", RegexOptions.Compiled); -var codeBlockRegex = new Regex("
((.|\n)+?)
", RegexOptions.Compiled); +var codeBlockRegex = new Regex("
((.|\n)+?)
", RegexOptions.Compiled); var codeRegex = new Regex("(.+?)", RegexOptions.Compiled); var linkRegex = new Regex("(.+?)", RegexOptions.Compiled); var brRegex = new Regex("
", RegexOptions.Compiled); @@ -210,7 +210,7 @@ string Link(string uid, bool linkFromGroupedType, bool nameOnly = false, bool li return Link(uid, linkFromGroupedType); }); summary = langwordXrefRegex.Replace(summary, match => $"`{match.Groups[1].Value}`"); - summary = codeBlockRegex.Replace(summary, match => $"```csharp\n{match.Groups[1].Value.Trim()}\n```"); + summary = codeBlockRegex.Replace(summary, match => $"```{match.Groups[1].Value.Trim()}\n{match.Groups[2].Value.Trim()}\n```"); summary = codeRegex.Replace(summary, match => $"`{match.Groups[1].Value}`"); summary = linkRegex.Replace(summary, match => $"[{match.Groups[2].Value}]({match.Groups[1].Value})"); summary = brRegex.Replace(summary, _ => config.BrNewline);