Improve "Fix alone lowercase 'i' to upper" slightly

This commit is contained in:
Nikolaj Olsson 2019-02-12 07:01:23 +01:00
parent 07dfe71c03
commit 077e31fd7e

View File

@ -37,11 +37,15 @@ namespace Nikse.SubtitleEdit.Core.Forms.FixCommonErrors
.Replace(">" + target + "\u200B" + Environment.NewLine, ">I" + Environment.NewLine) // Zero Width Space
.Replace(">" + target + "\uFEFF" + Environment.NewLine, ">I" + Environment.NewLine); // Zero Width No-Break Space
s = s.Replace(" i-i ", " I-I ");
s = s.Replace(" i-i-i ", " I-I-I ");
// reg-ex
Match match = re.Match(s);
while (match.Success)
{
if (s[match.Index] == target && !s.Substring(match.Index).StartsWith("i.e.", StringComparison.Ordinal))
if (s[match.Index] == target && !s.Substring(match.Index).StartsWith("i.e.", StringComparison.Ordinal) &&
!s.Substring(match.Index).StartsWith("i-", StringComparison.Ordinal))
{
var prev = '\0';
var next = '\0';