Browse Source

add > char to character sanitization

pull/1348/head
Chris Johnston 6 years ago
parent
commit
93b2b90aa2
2 changed files with 2 additions and 1 deletions
  1. +1
    -1
      src/Discord.Net.Core/Format.cs
  2. +1
    -0
      test/Discord.Net.Tests.Unit/FormatTests.cs

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

@@ -6,7 +6,7 @@ namespace Discord
public static class Format public static class Format
{ {
// Characters which need escaping // Characters which need escaping
private static readonly string[] SensitiveCharacters = { "\\", "*", "_", "~", "`", "|" };
private static readonly string[] SensitiveCharacters = { "\\", "*", "_", "~", "`", "|", ">" };


/// <summary> Returns a markdown-formatted string with bold formatting. </summary> /// <summary> Returns a markdown-formatted string with bold formatting. </summary>
public static string Bold(string text) => $"**{text}**"; public static string Bold(string text) => $"**{text}**";


+ 1
- 0
test/Discord.Net.Tests.Unit/FormatTests.cs View File

@@ -14,6 +14,7 @@ namespace Discord
[InlineData(@"~text~", @"\~text\~")] [InlineData(@"~text~", @"\~text\~")]
[InlineData(@"`text`", @"\`text\`")] [InlineData(@"`text`", @"\`text\`")]
[InlineData(@"_text_", @"\_text\_")] [InlineData(@"_text_", @"\_text\_")]
[InlineData(@"> text", @"\> text")]
public void Sanitize(string input, string expected) public void Sanitize(string input, string expected)
{ {
Assert.Equal(expected, Format.Sanitize(input)); Assert.Equal(expected, Format.Sanitize(input));


Loading…
Cancel
Save