Improved italic fix - thx XhmikosR :)

git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@2116 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
niksedk 2013-09-28 07:44:48 +00:00
parent 45456c5e4d
commit 489192eba0
3 changed files with 20 additions and 1 deletions

View File

@ -2352,6 +2352,10 @@ namespace Nikse.SubtitleEdit.Logic
else else
text = text.Substring(0, lastIndex - 1) + endTag; text = text.Substring(0, lastIndex - 1) + endTag;
} }
if (text.StartsWith("<i>") && text.EndsWith("</i>") && text.Contains("</i>" + Environment.NewLine + "<i>"))
{
text = text.Replace("</i>" + Environment.NewLine + "<i>", Environment.NewLine);
}
} }
if (italicBeginTagCount == 1 && italicEndTagCount == 0) if (italicBeginTagCount == 1 && italicEndTagCount == 0)

View File

@ -9,6 +9,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
TraceAndTestImpact.testsettings = TraceAndTestImpact.testsettings TraceAndTestImpact.testsettings = TraceAndTestImpact.testsettings
EndProjectSection EndProjectSection
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test", "Test\Test.csproj", "{7BE5B8E8-9469-4C7C-89D7-E8C884DEFC0E}"
EndProject
Global Global
GlobalSection(SubversionScc) = preSolution GlobalSection(SubversionScc) = preSolution
Svn-Managed = True Svn-Managed = True
@ -26,6 +28,10 @@ Global
{511A5B59-1C35-4719-8536-23B19AF9B21A}.Debug|Any CPU.Build.0 = Debug|Any CPU {511A5B59-1C35-4719-8536-23B19AF9B21A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{511A5B59-1C35-4719-8536-23B19AF9B21A}.Release|Any CPU.ActiveCfg = Release|Any CPU {511A5B59-1C35-4719-8536-23B19AF9B21A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{511A5B59-1C35-4719-8536-23B19AF9B21A}.Release|Any CPU.Build.0 = Release|Any CPU {511A5B59-1C35-4719-8536-23B19AF9B21A}.Release|Any CPU.Build.0 = Release|Any CPU
{7BE5B8E8-9469-4C7C-89D7-E8C884DEFC0E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7BE5B8E8-9469-4C7C-89D7-E8C884DEFC0E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7BE5B8E8-9469-4C7C-89D7-E8C884DEFC0E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7BE5B8E8-9469-4C7C-89D7-E8C884DEFC0E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View File

@ -255,6 +255,16 @@ namespace Test
Assert.AreEqual(target._subtitle.Paragraphs[0].Text, "<i>What do i care.</i>"); Assert.AreEqual(target._subtitle.Paragraphs[0].Text, "<i>What do i care.</i>");
} }
[TestMethod]
[DeploymentItem("SubtitleEdit.exe")]
public void FixItalicsLine1BadEndingDouble()
{
var target = new FixCommonErrors_Accessor();
InitializeFixCommonErrorsLine(target, "<i>To be a life-changing weekend</i>" + Environment.NewLine + "<i>for all of us.");
target.FixInvalidItalicTags();
Assert.AreEqual(target._subtitle.Paragraphs[0].Text, "<i>To be a life-changing weekend" + Environment.NewLine + "for all of us.</i>");
}
#endregion #endregion
#region Fix Missing Periods At End Of Line #region Fix Missing Periods At End Of Line
@ -374,7 +384,6 @@ namespace Test
} }
#endregion #endregion
#region Fix missingspaces #region Fix missingspaces
[TestMethod] [TestMethod]
[DeploymentItem("SubtitleEdit.exe")] [DeploymentItem("SubtitleEdit.exe")]