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

Improve VTT parsing #518

Merged
merged 2 commits into from
Jun 12, 2024
Merged

Improve VTT parsing #518

merged 2 commits into from
Jun 12, 2024

Conversation

cjcolvar
Copy link
Member

@cjcolvar cjcolvar commented Jun 11, 2024

Fixes #499 and improves handling of NOTE comments. Also includes spaces that were missing between lines of a cue or comment.

I removed cleanTimedText because I needed the new lines to flow through to groupTimedTextLines where I added additional handling of NOTE comments.

t.times = isNote ? "" : line;
t.tag = isNote ? TRANSCRIPT_CUE_TYPES.note : TRANSCRIPT_CUE_TYPES.timedCue;
t.line = isNote ? line : '';
// Make sure there is a single space separating NOTE from the comment for single or multi-line comments
t.line = isNote ? line.replace(/^NOTE\s*/,'NOTE ') : '';
i++;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this still need to be in the loop with adding i++ to the for loop declaration?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it advances to the next line so the while loop test starts with the line after the start of the cue/note.

@cjcolvar cjcolvar merged commit 4e4d093 into main Jun 12, 2024
2 checks passed
@cjcolvar cjcolvar deleted the proper_notes branch June 12, 2024 15:13
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.

Transcript component parses 'note' within cue-text as plain text
2 participants