mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-26 23:12:38 +02:00
Minor improvement for 'Fix dialogues on one line - thx David :)
This commit is contained in:
parent
fe30f89c5c
commit
82195a1b03
@ -184,7 +184,7 @@ namespace Nikse.SubtitleEdit.Core.Forms.FixCommonErrors
|
||||
string part0 = noTagLines[0];
|
||||
string part1 = noTagLines[1];
|
||||
if (part0.Length > 1 && "-—!?.\")]".Contains(part0[part0.Length - 1]) &&
|
||||
part1.Length > 1 && (char.IsUpper(part1[0]) || part1[0] == '\''))
|
||||
part1.Length > 1 && (char.IsUpper(part1[0]) || "\"'{[(".Contains(part1[0])))
|
||||
{
|
||||
text = text.Replace(" - ", Environment.NewLine + "- ");
|
||||
if (char.IsLetter((part0[0])) || CharUtils.IsDigit(part0[0]))
|
||||
|
@ -2006,6 +2006,15 @@ namespace Test
|
||||
Assert.AreEqual(result, target);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void FixDialogsOnOneLine5()
|
||||
{
|
||||
string source = "- [Gunshot] - [Scream]";
|
||||
string target = "- [Gunshot]" + Environment.NewLine + "- [Scream]";
|
||||
string result = Helper.FixDialogsOnOneLine(source, "en");
|
||||
Assert.AreEqual(result, target);
|
||||
}
|
||||
|
||||
#endregion Fix dialogs on one line
|
||||
|
||||
#region FixDoubleDash
|
||||
|
Loading…
Reference in New Issue
Block a user