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

Fix Ramp crashing when a SRT transcript is selected #511

Merged
merged 1 commit into from
May 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix Ramp crashing when a SRT transcript is selected
  • Loading branch information
Dananji committed May 28, 2024
commit a056b1b78d1b790586f52b6a01d4b8c72f69bc61
4 changes: 2 additions & 2 deletions src/services/transcript-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -661,8 +661,8 @@ function validateWebVTTHeaders(lines) {
* @returns {Array<String>}
*/
function cleanTimedText(lines) {
// Remove empty lines
let cue_lines = lines.filter((l) => l.length > 0);
// Remove empty lines and line numbers if they still exists (in SRT)
let cue_lines = lines.filter((l) => l.length > 0 && !Number(l));

// Strip white spaces and lines with index
let stripped = cue_lines.filter((l) => !/^[0-9]*[\r]/gm.test(l));
Expand Down