Fix line length issue in Netflix QC regarding italics - thx billysamk ;)

Related to #3129
This commit is contained in:
Nikolaj Olsson 2018-10-10 10:44:16 +02:00
parent df1a0989a2
commit 1109831f3e
2 changed files with 9 additions and 9 deletions

View File

@ -6,15 +6,15 @@ namespace Nikse.SubtitleEdit.Core.NetflixQualityCheck
{
/// <summary>
/// Maximum duration: 7 seconds per subtitle event
/// Maximum 42 chars per line for the majority of languages.
/// </summary>
public void Check(Subtitle subtitle, NetflixQualityController controller)
{
foreach (Paragraph p in subtitle.Paragraphs)
foreach (var p in subtitle.Paragraphs)
{
foreach (var line in p.Text.SplitToLines())
{
if (line.Length > controller.SingleLineMaxLength)
if (HtmlUtil.RemoveHtmlTags(line, true).Length > controller.SingleLineMaxLength)
{
var fixedParagraph = new Paragraph(p, false);
fixedParagraph.Text = Utilities.AutoBreakLine(fixedParagraph.Text, controller.SingleLineMaxLength, controller.SingleLineMaxLength - 3, controller.Language);

View File

@ -22,10 +22,6 @@ namespace Nikse.SubtitleEdit.Core.NetflixQualityCheck
{
if (!string.IsNullOrEmpty(Language))
{
if (Language == "ar") // Arabic
{
return 20;
}
if (Language == "ko") // Korean
{
return 12;
@ -35,7 +31,7 @@ namespace Nikse.SubtitleEdit.Core.NetflixQualityCheck
return 9;
}
}
return 17;
return 20;
}
}
@ -47,7 +43,7 @@ namespace Nikse.SubtitleEdit.Core.NetflixQualityCheck
{
if (Language == "ja") // Japanese
{
return 13;
return 23;
}
if (Language == "ko") // Korean
{
@ -76,6 +72,10 @@ namespace Nikse.SubtitleEdit.Core.NetflixQualityCheck
{
return false;
}
if (Language == "ar") // Arabic
{
return false;
}
}
return true;
}