From f891b76cfc4362946650c298c02bc06d04cdad54 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sun, 25 Jan 2015 11:13:07 -0500 Subject: [PATCH] Accept blank lines as valid subtitles. * srt2vtt (read-sub-rip): Allow the first subtitle line to be blank. --- srt2vtt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/srt2vtt b/srt2vtt index 27e0927..15c812f 100755 --- a/srt2vtt +++ b/srt2vtt @@ -66,7 +66,9 @@ two values: the start time and the end time. Valid input looks like ((start end) (parse-time-span (read-line port))) ((lines) (let loop ((lines '())) (let ((line (read-line port))) - (if (string-null? line) + (if (and (string-null? line) + ;; A subtitle may be a blank line! + (not (null? lines))) lines (loop (cons line lines))))))) (make-subtitle id start end lines))) -- 2.31.1