mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-27 22:42:38 +01:00
Allow dash in number for WebVTT files - thx Maksim :)
This commit is contained in:
parent
2e8a12803e
commit
07291a5313
@ -185,7 +185,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
{
|
||||
subtitle.Header = "WEBVTT";
|
||||
}
|
||||
else if (p != null && hadEmptyLine && Utilities.IsInteger(line) &&
|
||||
else if (p != null && hadEmptyLine && Utilities.IsInteger(line.RemoveChar('-')) &&
|
||||
(RegexTimeCodesMiddle.IsMatch(next) ||
|
||||
RegexTimeCodesShort.IsMatch(next) ||
|
||||
RegexTimeCodes.IsMatch(next)))
|
||||
|
@ -60,7 +60,6 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
Paragraph p = null;
|
||||
string positionInfo = string.Empty;
|
||||
bool hadEmptyLine = false;
|
||||
int numbers = 0;
|
||||
for (var index = 0; index < lines.Count; index++)
|
||||
{
|
||||
string line = lines[index];
|
||||
@ -112,12 +111,12 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
{
|
||||
subtitle.Header = "WEBVTT FILE";
|
||||
}
|
||||
else if (p != null && hadEmptyLine && Utilities.IsInteger(line) &&
|
||||
else if (p != null && hadEmptyLine && Utilities.IsInteger(line.RemoveChar('-')) &&
|
||||
(RegexTimeCodesMiddle.IsMatch(next) ||
|
||||
RegexTimeCodesShort.IsMatch(next) ||
|
||||
RegexTimeCodes.IsMatch(next)))
|
||||
{
|
||||
numbers++;
|
||||
// line number
|
||||
}
|
||||
else if (p != null)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user