Skip to content

Commit

Permalink
vttparser: strip of BOM characters - in regex
Browse files Browse the repository at this point in the history
related to #1307 #1286
  • Loading branch information
mangui committed Aug 28, 2017
1 parent 0a9bb0f commit d483291
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/utils/vttparser.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,7 @@ VTTParser.prototype = {
line = collectNextLine();
// strip of UTF-8 BOM if any
// https://en.wikipedia.org/wiki/Byte_order_mark#UTF-8
if (line.indexOf("") === 0) {
line = line.substr(3);
}
var m = line.match(/^WEBVTT([ \t].*)?$/);
var m = line.match(/^()?WEBVTT([ \t].*)?$/);
if (!m || !m[0]) {
throw new Error('Malformed WebVTT signature.');
}
Expand Down

0 comments on commit d483291

Please sign in to comment.