Browse Source

Removed Format.Code's escape parameter

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

+ 4
- 4
src/Discord.Net/Helpers/Format.cs View File

@@ -102,12 +102,12 @@ namespace Discord
=> escape ? $"~~{Escape(text)}~~" : $"~~{text}~~"; => escape ? $"~~{Escape(text)}~~" : $"~~{text}~~";


/// <summary> Returns a markdown-formatted string with strikeout formatting, optionally escaping the contents. </summary> /// <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)
public static string Code(string text, string language = null)
{ {
if (language != null || text.Contains("\n")) if (language != null || text.Contains("\n"))
return $"```{language ?? ""}\n{(escape ? Escape(text) : text)}\n```";
return $"```{language ?? ""}\n{text}\n```";
else else
return $"`{(escape ? Escape(text) : text)}`";
return $"`{text}`";
} }


/// <summary> Returns a markdown-formatted string with multiple formatting, optionally escaping the contents. </summary> /// <summary> Returns a markdown-formatted string with multiple formatting, optionally escaping the contents. </summary>
@@ -121,7 +121,7 @@ namespace Discord
if (italics) result = Italics(result, false); if (italics) result = Italics(result, false);
if (underline) result = Underline(result, false); if (underline) result = Underline(result, false);
if (strikeout) result = Strikeout(result, false); if (strikeout) result = Strikeout(result, false);
if (code) result = Code(result, codeLanguage, false);
if (code) result = Code(result, codeLanguage);
return result; return result;
} }
} }


Loading…
Cancel
Save