mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-27 22:42:38 +01:00
parent
33893f93df
commit
3e47effb77
@ -859,11 +859,11 @@ namespace Nikse.SubtitleEdit.Core.Forms
|
||||
text = st.Pre + text + st.Post;
|
||||
}
|
||||
|
||||
if (input.TrimStart().StartsWith("- ", StringComparison.Ordinal) &&
|
||||
if ((input.TrimStart().StartsWith("-", StringComparison.Ordinal) || input.TrimStart().StartsWith("<i>-", StringComparison.Ordinal)) &&
|
||||
text != null && !text.Contains(Environment.NewLine) &&
|
||||
(input.Contains(Environment.NewLine + "- ") ||
|
||||
(input.Contains(Environment.NewLine + "-") ||
|
||||
input.Contains(Environment.NewLine + " - ") ||
|
||||
input.Contains(Environment.NewLine + "<i>- ") ||
|
||||
input.Contains(Environment.NewLine + "<i>-") ||
|
||||
input.Contains(Environment.NewLine + "<i> - ")))
|
||||
{
|
||||
if (text.StartsWith("<i>-", StringComparison.Ordinal))
|
||||
@ -1267,6 +1267,12 @@ namespace Nikse.SubtitleEdit.Core.Forms
|
||||
{
|
||||
text = text.Remove(0, 1).TrimStart();
|
||||
}
|
||||
else if (text.Substring(0, start).EndsWith(", ") && text.Remove(0, start).TrimStart().StartsWith(','))
|
||||
{
|
||||
text = text.Substring(0, start).TrimEnd() + " " + text.Remove(0, start).TrimStart(' ', ',');
|
||||
text = text.Trim();
|
||||
}
|
||||
|
||||
start = text.IndexOf(startTag, StringComparison.Ordinal);
|
||||
}
|
||||
while (start >= 0 && text.Length - start - startTag.Length >= endTag.Length);
|
||||
|
@ -2,7 +2,6 @@
|
||||
using Nikse.SubtitleEdit.Core.Forms;
|
||||
using System;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Core.Dictionaries;
|
||||
|
||||
namespace Test.Logic.Forms
|
||||
{
|
||||
@ -1786,6 +1785,28 @@ namespace Test.Logic.Forms
|
||||
Assert.AreEqual(string.Empty, actual);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void RemoveHiSecondLineHiDialog()
|
||||
{
|
||||
var target = GetRemoveTextForHiLib();
|
||||
target.Settings.RemoveTextBeforeColon = true;
|
||||
target.Settings.RemoveTextBeforeColonOnlyUppercase = true;
|
||||
target.Settings.OnlyIfInSeparateLine = true;
|
||||
string actual = target.RemoveTextFromHearImpaired("<i>-Era stato avveritito.</i>" + Environment.NewLine + "-(PARLA IN SPANOLO)");
|
||||
Assert.AreEqual("<i>Era stato avveritito.</i>", actual);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void RemoveHiRemoveInLine()
|
||||
{
|
||||
var target = GetRemoveTextForHiLib();
|
||||
target.Settings.RemoveTextBeforeColon = true;
|
||||
target.Settings.RemoveTextBeforeColonOnlyUppercase = true;
|
||||
target.Settings.OnlyIfInSeparateLine = true;
|
||||
string actual = target.RemoveTextFromHearImpaired("Senti, [si schiarisce la voce]," + Environment.NewLine + "dille semplicemente che ti e mancata.");
|
||||
Assert.AreEqual("Senti," + Environment.NewLine + "dille semplicemente che ti e mancata.", actual);
|
||||
}
|
||||
|
||||
#region Additional test attributes
|
||||
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user