From 6b7bd809495afaaeef24a9577e08a35c661c54f7 Mon Sep 17 00:00:00 2001 From: niksedk Date: Fri, 15 Aug 2014 16:58:31 +0200 Subject: [PATCH] Do not auto-break dialogues where 1st line ends with: ." - thx XhmikosR :) --- src/Logic/Utilities.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Logic/Utilities.cs b/src/Logic/Utilities.cs index 789c28010..f4a905c29 100644 --- a/src/Logic/Utilities.cs +++ b/src/Logic/Utilities.cs @@ -550,9 +550,12 @@ namespace Nikse.SubtitleEdit.Logic { string dialogS = Utilities.RemoveHtmlTags(text); var arr = dialogS.Replace(Environment.NewLine, "\n").Split('\n'); - if (arr.Length == 2 && arr[0].Trim().StartsWith("-") && arr[1].Trim().StartsWith("-") && - (arr[0].Trim().EndsWith(".") || arr[0].Trim().EndsWith("!") || arr[0].Trim().EndsWith("?"))) - return text; + if (arr.Length == 2) + { + string arr0 = arr[0].Trim().TrimEnd('"').TrimEnd('\'').TrimEnd(); + if (arr0.StartsWith("-") && arr[1].Trim().StartsWith("-") && (arr0.EndsWith(".") || arr0.EndsWith("!") || arr0.EndsWith("?"))) + return text; + } } string s = text;