Fix bug in "Remove text for HI" - thx MosDos96 :)

Related to #2957
This commit is contained in:
Nikolaj Olsson 2018-07-06 13:00:37 +02:00
parent ec1beebcff
commit 5364893f2b
2 changed files with 13 additions and 1 deletions

View File

@ -90,7 +90,7 @@ namespace Nikse.SubtitleEdit.Core.Forms
// Okay or remove???
string noTagText = HtmlUtil.RemoveHtmlTags(text);
if (noTagText.Length > 10 && noTagText.IndexOf(':') == noTagText.Length - 1 && noTagText != noTagText.ToUpper())
return text;
return preAssTag + text;
string newText = string.Empty;
var lines = text.Trim().SplitToLines();

View File

@ -1678,6 +1678,18 @@ namespace Test.Logic.Forms
Assert.AreEqual("Gotta be ready before nightfall.", actual);
}
[TestMethod]
public void RemoveTextBetweenBeforeColonDoNotTouch()
{
var target = GetRemoveTextForHiLib();
target.Settings.RemoveTextBeforeColon = true;
target.Settings.RemoveTextBetweenParentheses = true;
var source = "{\\an8}But I know of something" + Environment.NewLine +
"<i>that could:</i>";
string actual = target.RemoveColon(source);
Assert.AreEqual(source, actual);
}
#region Additional test attributes
//