diff --git a/TSOClient/tso.client/UI/Panels/UIChatBalloon.cs b/TSOClient/tso.client/UI/Panels/UIChatBalloon.cs index 5c2afc6a2..2829c8781 100644 --- a/TSOClient/tso.client/UI/Panels/UIChatBalloon.cs +++ b/TSOClient/tso.client/UI/Panels/UIChatBalloon.cs @@ -9,6 +9,7 @@ using FSO.Client.UI.Controls; using FSO.SimAntics; using FSO.SimAntics.Model.TSOPlatform; +using FSO.Common.Utils; //using System.Speech.Synthesis; namespace FSO.Client.UI.Panels @@ -94,7 +95,7 @@ public void SetNameMessage(VMAvatar avatar) private string SanitizeBB(string input) { - return input.Replace("[", "\\["); + return BBCodeParser.SanitizeBB(input); } private void TextChanged() diff --git a/TSOClient/tso.client/UI/Panels/UIChatDialog.cs b/TSOClient/tso.client/UI/Panels/UIChatDialog.cs index f1cf0c6d9..fb4d19203 100644 --- a/TSOClient/tso.client/UI/Panels/UIChatDialog.cs +++ b/TSOClient/tso.client/UI/Panels/UIChatDialog.cs @@ -11,6 +11,7 @@ using FSO.Common.Rendering.Framework.IO; using FSO.SimAntics.Model.TSOPlatform; using FSO.Client.UI.Panels.Chat; +using FSO.Common.Utils; namespace FSO.Client.UI.Panels { @@ -359,7 +360,7 @@ public void RenderEvents() public string SanitizeBB(string input) { - return input.Replace("[", "\\["); + return BBCodeParser.SanitizeBB(input); } public string CleanUserMessage(string msg, VMChatEvent evt) diff --git a/TSOClient/tso.common/utils/BBCodeParser.cs b/TSOClient/tso.common/utils/BBCodeParser.cs index e107a3df8..cab3fe657 100644 --- a/TSOClient/tso.common/utils/BBCodeParser.cs +++ b/TSOClient/tso.common/utils/BBCodeParser.cs @@ -69,6 +69,7 @@ public BBCodeParser(string input) public static string SanitizeBB(string input) { + if (input.LastOrDefault() == '\\') input += ' '; return input.Replace("[", "\\["); } }