You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Although you mention, that you want to comply with JWPlayers VTT definition only, the official one https://www.w3.org/TR/webvtt1/ states, that Web Vtt timing has before and after --> one or more U+0020 SPACE characters or U+0009 CHARACTER TABULATION (tab) characters.
You already have a construct, which has an optional whitespace in ( ?--> ?), but this would allow even none space (e.g. 00:00:00.000-->00:00:0, which is not correct/allowed (context is in processVtt function matching vttDef variable: vttDef.match(/([0-9]{2}:)?([0-9]{2}:)?[0-9]{2}(.[0-9]{3})?( ?--> ?)([0-9]{2}:)?([0-9]{2}:)?[0-9]{2}(.[0-9]{3})?[\r\n]{1}.*/gi)).
I suggest changing this part to ( +?--> +?) (+ = one or more - ? becomes non greedy quantifier) or at least fix it by adding one extra optional space ( ?--> ?), that is the regex becomes: vttDef.match(/([0-9]{2}:)?([0-9]{2}:)?[0-9]{2}(.[0-9]{3})?( +?--> +?)([0-9]{2}:)?([0-9]{2}:)?[0-9]{2}(.[0-9]{3})?[\r\n]{1}.*/gi).
The text was updated successfully, but these errors were encountered:
Although you mention, that you want to comply with JWPlayers VTT definition only, the official one
https://www.w3.org/TR/webvtt1/
states, that Web Vtt timing has before and after --> one or more U+0020 SPACE characters or U+0009 CHARACTER TABULATION (tab) characters.You already have a construct, which has an optional whitespace in
( ?--> ?)
, but this would allow even none space (e.g.00:00:00.000-->00:00:0
, which is not correct/allowed (context is in processVtt function matching vttDef variable:vttDef.match(/([0-9]{2}:)?([0-9]{2}:)?[0-9]{2}(.[0-9]{3})?( ?--> ?)([0-9]{2}:)?([0-9]{2}:)?[0-9]{2}(.[0-9]{3})?[\r\n]{1}.*/gi)
).I suggest changing this part to
( +?--> +?)
(+ = one or more - ? becomes non greedy quantifier) or at least fix it by adding one extra optional space( ?--> ?)
, that is the regex becomes:vttDef.match(/([0-9]{2}:)?([0-9]{2}:)?[0-9]{2}(.[0-9]{3})?( +?--> +?)([0-9]{2}:)?([0-9]{2}:)?[0-9]{2}(.[0-9]{3})?[\r\n]{1}.*/gi)
.The text was updated successfully, but these errors were encountered: