Skip to content

Commit

Permalink
Fix Ramp crashing when a SRT transcript is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
Dananji committed May 28, 2024
1 parent 63fc83e commit fe12863
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit fe12863

Please sign in to comment.