mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-26 05:02:36 +01:00
Fix line length issue in Netflix QC regarding italics - thx billysamk ;)
Related to #3129
This commit is contained in:
parent
df1a0989a2
commit
1109831f3e
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user