Merge pull request #213 from dev-kittens/patch-1

Fix doubleBacktick replacing
This commit is contained in:
Astrid 2020-08-12 17:15:12 +02:00 committed by GitHub
commit 757997c314
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -212,7 +212,7 @@ namespace PluralKit.Bot
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, @"` `"),@"``");
if(input != null) return doubleBacktick.Replace(doubleBacktick.Replace(input, "`\ufeff`"),"`\ufeff`");
else return input;
}
@ -326,4 +326,4 @@ namespace PluralKit.Bot
return $"<{match.Value}>";
});
}
}
}