Fix crash in "Fix common errors" - thx Hardstylest :)

Fix #8651
This commit is contained in:
Nikolaj Olsson 2024-07-20 17:24:06 +02:00
parent 97e3e47b50
commit dfdb2aa2ab
3 changed files with 11 additions and 2 deletions

View File

@ -18,6 +18,7 @@
* Fix UI burn-in window spacing/width/height - thx Hafran420
* Fix crash in "Whisper Audio to text" if no audio - thx morrellaberdeen
* Fix running "Faster-Whisper-XXL" without "Faster-Whisper" - thx shanedk
* Fix crash in "Fix common errors" - thx Hardstylest
4.0.7 (8th July 2024)

View File

@ -1622,6 +1622,14 @@ namespace Test.Logic
Assert.IsTrue(line1Actual);
}
[TestMethod]
public void IsItalic14()
{
var line1 = "liebe</i> ♫ ♫ <i>Bevor es zu spät ist</i> ♫ ♫ <i>Das, was";
var line1Actual = ContinuationUtilities.IsItalic(line1);
Assert.IsFalse(line1Actual);
}
[TestMethod]
public void HasPrefix1()
{

View File

@ -839,7 +839,7 @@ namespace Nikse.SubtitleEdit.Core.Common
while (input.IndexOf("<i>", StringComparison.Ordinal) >= 0)
{
var startIndex = input.IndexOf("<i>", StringComparison.Ordinal);
var endIndex = input.IndexOf("</i>", StringComparison.Ordinal);
var endIndex = input.IndexOf("</i>", startIndex, StringComparison.Ordinal);
var textToRemove = endIndex >= 0 ? input.Substring(startIndex, (endIndex + 4) - startIndex) : input.Substring(startIndex);
input = input.Replace(textToRemove, string.Empty);
}