Minor fix in Fix common errors - Fix missing period... thx Joel :)

This commit is contained in:
Nikolaj Olsson 2014-08-11 18:08:39 +02:00
parent cea103923f
commit bbed109adb
2 changed files with 13 additions and 1 deletions

View File

@ -2071,8 +2071,9 @@ namespace Nikse.SubtitleEdit.Forms
tempNoHtml.Length > 0 &&
(!",.!?:;>-])♪♫…".Contains(tempNoHtml[tempNoHtml.Length - 1].ToString())))
{
string tempTrimmed = tempNoHtml.TrimEnd().TrimEnd(new char[] { '\'', '"', '“', '”' }).TrimEnd();
if (!tempNoHtml.EndsWith(")") && !tempNoHtml.EndsWith("]") && !tempNoHtml.EndsWith("*") && !tempNoHtml.EndsWith("#") && !tempNoHtml.EndsWith("¶") && // hear impaired
!tempNoHtml.EndsWith(".\"") && !tempNoHtml.EndsWith("!\"") && !tempNoHtml.EndsWith("?\"") && !tempNoHtml.EndsWith(".“") && !tempNoHtml.EndsWith(".”"))
!tempTrimmed.EndsWith(".") && !tempTrimmed.EndsWith("!") && !tempTrimmed.EndsWith("?"))
{
if (p.Text != p.Text.ToUpper())
{

View File

@ -312,6 +312,17 @@ namespace Test
target.FixMissingPeriodsAtEndOfLine();
Assert.AreEqual(target._subtitle.Paragraphs[0].Text, "<i>This is line one!" + Environment.NewLine + "Boy.</i>");
}
[TestMethod]
[DeploymentItem("SubtitleEdit.exe")]
public void FixMissingPeriodsAtEndOfLineWithSpace()
{
var target = GetFixCommonErrorsLib();
InitializeFixCommonErrorsLine(target, "”... and gently down I laid her. ”");
target.FixMissingPeriodsAtEndOfLine();
Assert.AreEqual(target._subtitle.Paragraphs[0].Text, "”... and gently down I laid her. ”");
}
#endregion
#region Fix Hyphens (add dash)