mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-27 14:32:35 +01:00
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:
parent
45456c5e4d
commit
489192eba0
@ -2352,6 +2352,10 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
else
|
||||
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)
|
||||
|
@ -9,6 +9,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
|
||||
TraceAndTestImpact.testsettings = TraceAndTestImpact.testsettings
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test", "Test\Test.csproj", "{7BE5B8E8-9469-4C7C-89D7-E8C884DEFC0E}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SubversionScc) = preSolution
|
||||
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}.Release|Any CPU.ActiveCfg = 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
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
@ -255,6 +255,16 @@ namespace Test
|
||||
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
|
||||
|
||||
#region Fix Missing Periods At End Of Line
|
||||
@ -374,7 +384,6 @@ namespace Test
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region Fix missingspaces
|
||||
[TestMethod]
|
||||
[DeploymentItem("SubtitleEdit.exe")]
|
||||
|
Loading…
Reference in New Issue
Block a user