Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow timestamps of srt and vtt files with a 1-digit hour #45

Merged
merged 2 commits into from
Aug 27, 2020

Conversation

tzpr
Copy link
Contributor

@tzpr tzpr commented Aug 10, 2020

This pull request contains change suggestion for the regular expressions that parse the timestamps of srt and vtt files. The goal is to handle also timestamps that have only one digit in the hour part. This change is related to the issue #31 .

Motivation for the change was that some programs that generate srt subtitle files use 1 to n digits in the hour part of the timestamp while subtitle.js originally expects 2 to n digits in the hour part of the timestamp. This resulted in malformed vtt files in the cases where 1-digit hour was present in the srt file's timestamp.

New unit tests for verifying the changes were added to the parseTImestamps.test.js file.

@coveralls
Copy link

coveralls commented Aug 10, 2020

Coverage Status

Coverage remained the same at 91.515% when pulling f73c60d on tzpr:master into 072cb6e on gsantiago:master.

@gsantiago gsantiago merged commit d4b2e9e into gsantiago:master Aug 27, 2020
@gsantiago
Copy link
Owner

@tzpr thanks. I'll publish it soon

@gsantiago
Copy link
Owner

Published as 2.0.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants