Fix "remove text for hi" issue - thx btsix :)

This commit is contained in:
niksedk 2019-03-17 19:35:55 +01:00
parent 59978497b0
commit b4c9e8e88b
2 changed files with 18 additions and 1 deletions

View File

@ -472,7 +472,7 @@ namespace Nikse.SubtitleEdit.Core.Forms
if (arr0.Length > 0 && arr1.Length > 1)
{
// line continuation?
if (char.IsLower(arr1[0])) // second line starts with lower case letter
if (char.IsLower(arr1[0]) && arr[1][0] != '(' && arr[1][0] != '[') // second line starts with lower case letter
{
char c = arr0[arr0.Length - 1];
if (char.IsLower(c) || c == ',') // first line ends with comma or lower case letter

View File

@ -230,6 +230,23 @@ namespace Test.Logic.Forms
Assert.AreEqual(expected, actual);
}
[TestMethod]
public void RemoveColonTest11()
{
var target = GetRemoveTextForHiLib();
target.Settings.RemoveIfAllUppercase = true;
target.Settings.RemoveTextBeforeColon = true;
target.Settings.OnlyIfInSeparateLine = false;
target.Settings.OnlyIfInSeparateLine = false;
target.Settings.ColonSeparateLine = false;
target.Settings.RemoveTextBetweenParentheses = true;
target.Settings.RemoveTextBeforeColonOnlyUppercase = false;
string text = "- He's got the clap." + Environment.NewLine + "- SAM: (gasps) What?";
string expected = "- He's got the clap." + Environment.NewLine + "- What?";
string actual = target.RemoveTextFromHearImpaired(text);
Assert.AreEqual(expected, actual);
}
/// <summary>
/// A test for RemoveHIInsideLine
/// </summary>