Skip to content

Improve VTT parsing - #518

Merged
cjcolvar merged 2 commits into
mainfrom
proper_notes
Jun 12, 2024
Merged

Improve VTT parsing#518
cjcolvar merged 2 commits into
mainfrom
proper_notes

Conversation

@cjcolvar

@cjcolvar cjcolvar commented Jun 11, 2024

Copy link
Copy Markdown
Member

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.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
Copy Markdown
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
Copy Markdown
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
@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