Fix (probably extremely rare) missing space before $ - thx Aleksander :)

This commit is contained in:
Nikolaj Olsson 2020-06-20 10:39:23 +02:00
parent dc3a1c4897
commit 5d88099601
2 changed files with 12 additions and 1 deletions

View File

@ -276,7 +276,7 @@ namespace Nikse.SubtitleEdit.Core.Forms.FixCommonErrors
{
if (newText.Length > index + 4 && index >= 1)
{
if (Utilities.AllLettersAndNumbers.Contains(newText[index + 3]) &&
if ((Utilities.AllLettersAndNumbers + "$").Contains(newText[index + 3]) &&
Utilities.AllLettersAndNumbers.Contains(newText[index - 1]))
{
newText = newText.Insert(index + 3, " ");

View File

@ -707,6 +707,17 @@ namespace Test.FixCommonErrors
}
}
[TestMethod]
public void FixMissingSpacesAfterThreeDotsBeforeDollarSign()
{
using (var target = GetFixCommonErrorsLib())
{
InitializeFixCommonErrorsLine(target, "Give me...$20!");
new FixMissingSpaces().Fix(_subtitle, new EmptyFixCallback { Language = "en" });
Assert.AreEqual("Give me... $20!", _subtitle.Paragraphs[0].Text);
}
}
[TestMethod]
public void FixMissingSwedish()
{