File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -167,16 +167,14 @@ def _compute_blocks(self, lines):
167167 blocks = []
168168
169169 for index , line in enumerate (lines , start = 1 ):
170- # clean up exstraneous whitespace
171- final_line = line .strip ()
172-
173- # Remove empty lines
174- if final_line :
170+ if line :
175171 if not blocks :
176172 blocks .append (Block (index ))
177173 if not blocks [- 1 ].lines :
174+ if not line .strip ():
175+ continue
178176 blocks [- 1 ].line_number = index
179- blocks [- 1 ].lines .append (final_line )
177+ blocks [- 1 ].lines .append (line )
180178 else :
181179 blocks .append (Block (index ))
182180
@@ -198,7 +196,7 @@ def _parse_cue_block(self, block):
198196 '{} in line {}' .format (e , block .line_number + line_number ))
199197 else :
200198 additional_blocks = self ._compute_blocks (
201- ['WEBVTT' , '\n ' ] + block .lines [line_number :]
199+ ['WEBVTT' , '' ] + block .lines [line_number :]
202200 )
203201 break
204202 elif line_number == 0 :
You can’t perform that action at this time.
0 commit comments