Fixed bug in "Fix invalid italic tags" - thx XhmikosR :)

This commit is contained in:
niksedk 2014-08-24 08:12:31 +02:00
parent 62a7550500
commit a0842b1357
2 changed files with 19 additions and 1 deletions

View File

@ -2714,7 +2714,7 @@ namespace Nikse.SubtitleEdit.Logic
isStart = true;
if (text.EndsWith(endTag) || text.EndsWith(e1) || text.EndsWith(e2) || text.EndsWith(e3) || text.EndsWith(e4) || text.EndsWith(e5))
isEnd = true;
return isStart == isEnd;
return isStart && isEnd;
}
public static Paragraph GetOriginalParagraph(int index, Paragraph paragraph, List<Paragraph> originalParagraphs)

View File

@ -71,6 +71,24 @@ namespace Test
Assert.AreEqual(s2, "<i>Line 1." + Environment.NewLine + "Line 2.</i>");
}
[TestMethod]
[DeploymentItem("SubtitleEdit.exe")]
public void FixInvalidItalicTags4()
{
string s1 = "It <i>is</i> a telegram," + Environment.NewLine + "it <i>is</i> ordering an advance,";
string s2 = Utilities.FixInvalidItalicTags(s1);
Assert.AreEqual(s2, s1);
}
[TestMethod]
[DeploymentItem("SubtitleEdit.exe")]
public void FixInvalidItalicTags5()
{
string s1 = "- <i>It is a telegram?</i>" + Environment.NewLine + "<i>- It is.</i>";
string s2 = Utilities.FixInvalidItalicTags(s1);
Assert.AreEqual(s2, "<i>- It is a telegram?" + Environment.NewLine + "- It is.</i>");
}
[TestMethod]
[DeploymentItem("SubtitleEdit.exe")]
public void FixUnneededSpacesDoubleSpace1()