Allow merge length, 200, is not without html/assa tags

This commit is contained in:
niksedk 2023-01-22 09:46:17 +01:00
parent 1c00135ef3
commit 1fe04ad56d

View File

@ -12232,8 +12232,6 @@ namespace Nikse.SubtitleEdit.Forms
addText = RemoveAssStartAlignmentTag(addText);
}
addText = RemoveAssaKarokeTag(addText);
if (breakMode == BreakMode.UnbreakNoSpace)
{
sb.Append(addText);
@ -12246,7 +12244,7 @@ namespace Nikse.SubtitleEdit.Forms
endMilliseconds = _subtitle.Paragraphs[index].EndTime.TotalMilliseconds;
}
if (sb.Length > 200)
if (HtmlUtil.RemoveHtmlTags(sb.ToString(), true).Length > 200)
{
return;
}
@ -12649,18 +12647,6 @@ namespace Nikse.SubtitleEdit.Forms
return s;
}
private static string RemoveAssaKarokeTag(string text)
{
var s = text.TrimStart();
var end = s.IndexOf('}');
if (end > 5 && end < 9 && s.StartsWith("{\\k", StringComparison.Ordinal))
{
s = s.Remove(0, end + 1);
}
return s;
}
private void UpdateStartTimeInfo(TimeCode startTime)
{
if (_subtitle.Paragraphs.Count > 0 && SubtitleListview1.SelectedItems.Count > 0 && startTime != null)