mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 03:02:35 +01:00
Add some merge for WebVTT
This commit is contained in:
parent
7cf43f3d2e
commit
d567266289
@ -340,7 +340,11 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
|||||||
paragraph.StartTime.TotalMilliseconds += addSeconds * 1000;
|
paragraph.StartTime.TotalMilliseconds += addSeconds * 1000;
|
||||||
paragraph.EndTime.TotalMilliseconds += addSeconds * 1000;
|
paragraph.EndTime.TotalMilliseconds += addSeconds * 1000;
|
||||||
}
|
}
|
||||||
subtitle.Renumber();
|
|
||||||
|
var merged = MergeLinesSameTextUtils.MergeLinesWithSameTextInSubtitle(subtitle, false, 1);
|
||||||
|
subtitle.Paragraphs.Clear();
|
||||||
|
subtitle.Paragraphs.AddRange(merged.Paragraphs);
|
||||||
|
|
||||||
if (header.Length > 0)
|
if (header.Length > 0)
|
||||||
{
|
{
|
||||||
subtitle.Header = header
|
subtitle.Header = header
|
||||||
@ -585,7 +589,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
|||||||
}
|
}
|
||||||
text = System.Net.WebUtility.HtmlDecode(text);
|
text = System.Net.WebUtility.HtmlDecode(text);
|
||||||
|
|
||||||
var match = regexWebVttColorMulti.Match(text);
|
var match = regexWebVttColorMulti.Match(text);
|
||||||
while (match.Success)
|
while (match.Success)
|
||||||
{
|
{
|
||||||
var tag = match.Value.Substring(3, match.Value.Length - 4);
|
var tag = match.Value.Substring(3, match.Value.Length - 4);
|
||||||
@ -684,7 +688,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
|||||||
{
|
{
|
||||||
res = res.Remove(endIndex, 4).Insert(endIndex, "</font>");
|
res = res.Remove(endIndex, 4).Insert(endIndex, "</font>");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var findString = $"</c.{value}>";
|
var findString = $"</c.{value}>";
|
||||||
endIndex = res.IndexOf(findString, match.Index, StringComparison.OrdinalIgnoreCase);
|
endIndex = res.IndexOf(findString, match.Index, StringComparison.OrdinalIgnoreCase);
|
||||||
|
Loading…
Reference in New Issue
Block a user