From 8e44311a54d978f837abe3ba914f14123b52205a Mon Sep 17 00:00:00 2001 From: RogueException Date: Thu, 15 Oct 2015 03:30:24 -0300 Subject: [PATCH] Default to multiline codeblock if a language is specified --- src/Discord.Net/Format.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Discord.Net/Format.cs b/src/Discord.Net/Format.cs index 42cad6877..eda143d2e 100644 --- a/src/Discord.Net/Format.cs +++ b/src/Discord.Net/Format.cs @@ -104,7 +104,7 @@ namespace Discord /// Returns a markdown-formatted string with strikeout formatting, optionally escaping the contents. public static string Code(string text, string language = null, bool escape = true) { - if (text.Contains("\n")) + if (language != null || text.Contains("\n")) return $"```{language ?? ""}\n{(escape ? Escape(text) : text)}\n```"; else return $"`{(escape ? Escape(text) : text)}`";