mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-21 18:52:36 +01:00
Merge pull request #7976 from ivandrofly/feature/add-missing-quote
Refactor quotes replacement in FixCommonErrors
This commit is contained in:
commit
b77e613f6f
@ -243,14 +243,20 @@ namespace Nikse.SubtitleEdit.Core.Forms.FixCommonErrors
|
||||
return text;
|
||||
}
|
||||
|
||||
if (Utilities.CountTagInText(text, "\"") == 1 && Utilities.CountTagInText(text, "”") == 1)
|
||||
const string doubleQuote = "\"";
|
||||
if (Utilities.CountTagInText(text, doubleQuote) == 1)
|
||||
{
|
||||
return text.Replace("”", "\"");
|
||||
}
|
||||
if (Utilities.CountTagInText(text, "\"") == 1 && Utilities.CountTagInText(text, "“") == 1)
|
||||
{
|
||||
return text.Replace("“", "\"");
|
||||
if (Utilities.CountTagInText(text, "”") == 1)
|
||||
{
|
||||
return text.Replace("”", doubleQuote);
|
||||
}
|
||||
|
||||
if (Utilities.CountTagInText(text, "“") == 1)
|
||||
{
|
||||
return text.Replace("“", doubleQuote);
|
||||
}
|
||||
}
|
||||
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user