Merge pull request #4391 from OmrSi/use-countcharacters

Use "CountCharacters" in two more places
This commit is contained in:
Nikolaj Olsson 2020-09-28 12:17:14 +02:00 committed by GitHub
commit 9bceb27b9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -16,7 +16,7 @@ namespace Nikse.SubtitleEdit.Core.Forms.FixCommonErrors
bool tooLong = false;
foreach (string line in lines)
{
if (HtmlUtil.RemoveHtmlTags(line, true).Length > Configuration.Settings.General.SubtitleLineMaximumLength)
if (HtmlUtil.RemoveHtmlTags(line, true).CountCharacters(false, Configuration.Settings.General.IgnoreArabicDiacritics) > Configuration.Settings.General.SubtitleLineMaximumLength)
{
tooLong = true;
break;

View File

@ -228,7 +228,7 @@ namespace Nikse.SubtitleEdit.Core.Forms
bool doBreak = false;
foreach (var line in s.SplitToLines())
{
if (HtmlUtil.RemoveHtmlTags(line, true).Length > Configuration.Settings.General.SubtitleLineMaximumLength)
if (HtmlUtil.RemoveHtmlTags(line, true).CountCharacters(false, Configuration.Settings.General.IgnoreArabicDiacritics) > Configuration.Settings.General.SubtitleLineMaximumLength)
{
doBreak = true;
break;