Browse Source

Default to multiline codeblock if a language is specified

tags/docs-0.9
RogueException 9 years ago
parent
commit
8e44311a54
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/Discord.Net/Format.cs

+ 1
- 1
src/Discord.Net/Format.cs View File

@@ -104,7 +104,7 @@ namespace Discord
/// <summary> Returns a markdown-formatted string with strikeout formatting, optionally escaping the contents. </summary>
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)}`";


Loading…
Cancel
Save