We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 95eea28 commit cf7739bCopy full SHA for cf7739b
src/vtt/vtt-parser.ts
@@ -115,8 +115,13 @@ export class VTTParser implements CaptionsParser {
115
protected _parseHeader(line: string, lineCount: number) {
116
if (lineCount > 1) {
117
if (SETTING_SEP_RE.test(line)) {
118
- const [key, value] = line.split(SETTING_SEP_RE);
119
- if (key) this._metadata[key] = (value || '').replace(SPACE_RE, '');
+ const separatorIndex = line.indexOf(SETTING_SEP_RE);
+ if (separatorIndex !== -1) {
120
+ const key = line.substring(0, separatorIndex);
121
+ const value = line.substring(separatorIndex + SETTING_SEP_RE.length);
122
+ this._metadata[key] = (value || '').trim()
123
+ }
124
+ if (key)
125
}
126
} else if (line.startsWith(HEADER_MAGIC)) {
127
this._block = VTTBlock.Header;
0 commit comments