diff --git a/Changelog.txt b/Changelog.txt index 664f23f6f..54c056fbb 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -55,6 +55,7 @@ * Fix crash in "Fix commo errors" - thx dramirvf * Fix auto generate waveform with video with empty audio - thx LeonCheung * Fix a few broken spell check dictionary links + * Fix removing italic when toggling music symbols - thx Charvelx04 4.0.3 (23rd December 2023) diff --git a/src/libse/Common/Utilities.cs b/src/libse/Common/Utilities.cs index f8923b25f..6d757823f 100644 --- a/src/libse/Common/Utilities.cs +++ b/src/libse/Common/Utilities.cs @@ -3191,12 +3191,12 @@ namespace Nikse.SubtitleEdit.Core.Common { return pre + text.Replace(tag, string.Empty).Replace(endTag, string.Empty).Replace(Environment.NewLine + " ", Environment.NewLine).Replace(" " + Environment.NewLine, Environment.NewLine).Trim() + post; } - + if (string.IsNullOrEmpty(endTag) && !string.IsNullOrEmpty(tag)) { return pre + text.Replace(tag, string.Empty).Replace(Environment.NewLine + " ", Environment.NewLine).Replace(" " + Environment.NewLine, Environment.NewLine).Trim() + post; } - + if (!string.IsNullOrEmpty(endTag)) { return pre + text.Replace(endTag, string.Empty).Replace(Environment.NewLine + " ", Environment.NewLine).Replace(" " + Environment.NewLine, Environment.NewLine).Trim() + post; @@ -3206,7 +3206,6 @@ namespace Nikse.SubtitleEdit.Core.Common return pre + text + post; } - public static string AddSymbols(string tag, string text, string endTag) { text = RemoveSymbols(tag, text, endTag);