mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-23 03:33:18 +01:00
parent
a7b24f6eca
commit
63c8ed0302
@ -390,7 +390,7 @@ namespace Nikse.SubtitleEdit.Core.Forms
|
||||
else if (newText.Contains('-') && !newText.Contains(Environment.NewLine))
|
||||
{
|
||||
var st = new StrippableText(newText);
|
||||
if (st.Pre.Contains('-'))
|
||||
if (st.Pre.Contains('-') && !st.Pre.Contains("--"))
|
||||
newText = st.Pre.Replace("-", string.Empty) + st.StrippedText + st.Post;
|
||||
}
|
||||
else if (removedInSecondLine && !removedInFirstLine && Utilities.GetNumberOfLines(newText) == 2)
|
||||
|
@ -1599,6 +1599,39 @@ namespace Test.Logic.Forms
|
||||
Assert.AreEqual("Captain's log, stardate 1514. 1:", actual);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void DontRemoveDoubleDashInSecondLine()
|
||||
{
|
||||
var target = GetRemoveTextForHiLib();
|
||||
target.Settings.RemoveTextBetweenSquares = true;
|
||||
target.Settings.RemoveInterjections = false;
|
||||
target.Settings.RemoveTextBetweenCustomTags = false;
|
||||
string actual = target.RemoveTextFromHearImpaired("BALOK[OVER RADIO]:" + Environment.NewLine + "<i>--and trespassed into our star systems.</i>");
|
||||
Assert.AreEqual("<i>--and trespassed into our star systems.</i>", actual);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void DontRemoveDoubleDashInSecondLine2()
|
||||
{
|
||||
var target = GetRemoveTextForHiLib();
|
||||
target.Settings.RemoveTextBetweenSquares = true;
|
||||
target.Settings.RemoveInterjections = false;
|
||||
target.Settings.RemoveTextBetweenCustomTags = false;
|
||||
string actual = target.RemoveTextFromHearImpaired("BALOK[OVER RADIO]:" + Environment.NewLine + "--and trespassed into our star systems.");
|
||||
Assert.AreEqual("--and trespassed into our star systems.", actual);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void DontRemoveDoubleDashInSecondLine3()
|
||||
{
|
||||
var target = GetRemoveTextForHiLib();
|
||||
target.Settings.RemoveTextBetweenSquares = true;
|
||||
target.Settings.RemoveInterjections = false;
|
||||
target.Settings.RemoveTextBetweenCustomTags = false;
|
||||
string actual = target.RemoveTextFromHearImpaired("BALOK[OVER RADIO]:" + Environment.NewLine + "<i>—and trespassed into our star systems.</i>");
|
||||
Assert.AreEqual("<i>—and trespassed into our star systems.</i>", actual);
|
||||
}
|
||||
|
||||
#region Additional test attributes
|
||||
|
||||
//
|
||||
|
@ -22,7 +22,7 @@ namespace Test.Logic
|
||||
if (Directory.Exists(Path.Combine(Configuration.BaseDirectory, "Languages")))
|
||||
{
|
||||
string[] versionInfo = Utilities.AssemblyVersion.Split('.');
|
||||
string currentVersion = String.Format("{0}.{1}.{2}", versionInfo[0], versionInfo[1], versionInfo[2]);
|
||||
string currentVersion = string.Format("{0}.{1}.{2}", versionInfo[0], versionInfo[1], versionInfo[2]);
|
||||
|
||||
foreach (string fileName in Directory.GetFiles(Path.Combine(Configuration.BaseDirectory, "Languages"), "*.xml"))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user