Fix: Escape Backticks (#192)
This commit is contained in:
@@ -192,6 +192,13 @@ namespace PluralKit.Bot
|
||||
else return input;
|
||||
}
|
||||
|
||||
public static string EscapeBacktickPair(this string input){
|
||||
Regex doubleBacktick = new Regex(@"``", RegexOptions.Multiline);
|
||||
//Run twice to catch any pairs that are created from the first pass, pairs shouldn't be created in the second as they are created from odd numbers of backticks, even numbers are all caught on the first pass
|
||||
if(input != null) return doubleBacktick.Replace(doubleBacktick.Replace(input, @"``"),@"``");
|
||||
else return input;
|
||||
}
|
||||
|
||||
public static Task<DiscordUser> GetUser(this DiscordRestClient client, ulong id) =>
|
||||
WrapDiscordCall(client.GetUserAsync(id));
|
||||
|
||||
|
@@ -14,7 +14,7 @@ using PluralKit.Core;
|
||||
namespace PluralKit.Bot
|
||||
{
|
||||
public static class MiscUtils {
|
||||
public static string ProxyTagsString(this PKMember member) => string.Join(", ", member.ProxyTags.Select(t => $"`{t.ProxyString.EscapeMarkdown()}`"));
|
||||
public static string ProxyTagsString(this PKMember member) => string.Join(", ", member.ProxyTags.Select(t => $"``{t.ProxyString.EscapeBacktickPair()}``"));
|
||||
|
||||
public static bool IsOurProblem(this Exception e)
|
||||
{
|
||||
|
Reference in New Issue
Block a user