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

Support parsing metadata from input #19

Merged
merged 1 commit into from
Mar 15, 2019
Merged

Conversation

abstractvector
Copy link
Contributor

In reference to issue #18, this pull request adds support for an options object of the form { meta: true } to be passed through to the parse() method. If specified, any additional lines after the WEBVTT line will be parsed - split on the : separator, trimmed and inserted into a meta object on the response.

If the option is false or not passed in, a meta property is not included in the response. If it is true but there is no metadata available, the response includes meta: null.

I have added several more tests and the entire suite is passing. I have also updated README.md to include usage.

I have not updated the compiler so metadata will not be compiled into a string. This shouldn't be challenging but we're not using the compile functionality of this module.

@osk osk merged commit 52dea41 into osk:master Mar 15, 2019
@osk
Copy link
Owner

osk commented Mar 15, 2019

Released in v1.3

@abstractvector
Copy link
Contributor Author

Great, thanks for the quick merge and release!

@osk
Copy link
Owner

osk commented Mar 16, 2019

No problem, thanks for the PR.

@meoyawn
Copy link

meoyawn commented Jun 23, 2023

unfortunately segmenter did not benefit from this change

const parsed = parse(input);

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.

3 participants