From b73ab3e4b9ce7e9d32db114dec462fdf7f31be3b Mon Sep 17 00:00:00 2001 From: niksedk Date: Thu, 31 Jul 2014 20:46:15 +0200 Subject: [PATCH] Fix bug in break long lines - thx moob :) --- src/Logic/Utilities.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/Logic/Utilities.cs b/src/Logic/Utilities.cs index bb6e346a3..36efa5017 100644 --- a/src/Logic/Utilities.cs +++ b/src/Logic/Utilities.cs @@ -818,6 +818,13 @@ namespace Nikse.SubtitleEdit.Logic if(s.Contains("< ")) s = FixInvalidItalicTags(s); + s = RemoveSingleLetterHtmlTags(s); + s = RemoveParagraphTag(s); + return RemoveHtmlFontTag(s); + } + + private static string RemoveSingleLetterHtmlTags(string s) + { s = s.Replace("", string.Empty); s = s.Replace("<і>", string.Empty); // different unicode chars s = s.Replace("", string.Empty); @@ -832,8 +839,7 @@ namespace Nikse.SubtitleEdit.Logic s = s.Replace("", string.Empty); s = s.Replace("", string.Empty); s = s.Replace("", string.Empty); - s = RemoveParagraphTag(s); - return RemoveHtmlFontTag(s); + return s; } public static string RemoveHtmlTags(string s, bool alsoSsaTags) @@ -2490,6 +2496,8 @@ namespace Nikse.SubtitleEdit.Logic text = text.Replace("< /i>", endTag); text = text.Replace("< /i >", endTag); text = text.Replace("", endTag); + text = text.Replace("", endTag); + text = text.Replace("< / i>", endTag); text = text.Replace("< /I>", endTag); text = text.Replace("", endTag); text = text.Replace("< /I>", endTag); @@ -2590,7 +2598,7 @@ namespace Nikse.SubtitleEdit.Logic if (italicBeginTagCount == 0 && italicEndTagCount == 1) { - string cleanText = RemoveHtmlTags(text); + string cleanText = RemoveSingleLetterHtmlTags(text); bool isFixed= false; // Foo.