From 6b53f96f9baeaef52f7c002ac06dc7d2950b0788 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Tue, 28 Nov 2017 14:27:34 +1100 Subject: [PATCH] Fix IRC bold/italic/underline formatting chars not being stripped. --- MCGalaxy/Chat/Colors.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/MCGalaxy/Chat/Colors.cs b/MCGalaxy/Chat/Colors.cs index d072c0856..9302b58aa 100644 --- a/MCGalaxy/Chat/Colors.cs +++ b/MCGalaxy/Chat/Colors.cs @@ -142,8 +142,13 @@ namespace MCGalaxy { sb.Replace(ircSingle[i], ircReplacements[i]); } - sb.Replace("\u0003", white); // color reset - sb.Replace("\u000f", white); // reset + // trim misc formatting chars + sb.Replace("\x02", ""); // bold + sb.Replace("\x1D", ""); // italic + sb.Replace("\x1F", ""); // underline + + sb.Replace("\x03", white); // color reset + sb.Replace("\x0f", white); // reset return sb.ToString(); }