Closed nogarcia closed 2 years ago
Done! Leading and ending spaces are now stripped from the segments, and line breaking is applied to both VTT and SRT outputs. To avoid duplicating some code, I moved the leading space removal and the line breaking into a method called process_segment
, which is called in both write_vtt
and write_srt
.
Closes #1
Sorry for taking so long! The problem turned out to be a little more (or less) complicated than I thought.
The approach I take here is to get the middle of the string (so that the lines are roughly even) and decrement that slice until it hits a space. This works well but makes some choices I'll list in case you want to change them:
--break-lines N
option. A single flag made sense to me, but if you'd rather have--break-lines
and--line-length
, I'm open to that.