mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 03:02:35 +01:00
Fix "remove text for hi" issue - thx btsix :)
This commit is contained in:
parent
59978497b0
commit
b4c9e8e88b
@ -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
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user