Open mlitwin opened 1 year ago
We would need to make sure \r\n
can never be interpreted as two line breaks which wuld also break parsing.
Yeah - thought the https://github.com/videojs/vtt.js/blob/2eb1ea469f06478cd40268fe9d7de5746dee60fb/lib/parser/parser.js#L45C12-L45C27 collectNextLine()
function seems like it already handles that case. There's another regex at https://github.com/videojs/vtt.js/blob/2eb1ea469f06478cd40268fe9d7de5746dee60fb/lib/parser/parser.js#L192 that looks like it needs an \r
test.
VTT files with carriage return (CR
\r
) line endings are rejected by the parser with aParsingError.Errors.BadSignature
error.Issue seems to be the regex at https://github.com/videojs/vtt.js/blob/2eb1ea469f06478cd40268fe9d7de5746dee60fb/lib/parser/parser.js#L175 not handling the
\r
case, resulting in downstream rejection because it seems like there's only one line in the vtt.Per https://www.w3.org/TR/webvtt1/#webvtt-line-terminator "A single U+000D CARRIAGE RETURN (CR) character." should be supported.
Other notes: