Display overlapping subtitles I used YouTube to autogenerate subtitles for a video. The srt file looks something like this:

0:00:00.060,0:00:07.080
first caption

0:00:03.240,0:00:09.599
second caption

0:00:07.080,0:00:13.019
third caption




As you can see, the captions overlap in time. The first caption is present for seconds 0-7, while the second caption is present for seconds 3-9. The result in YouTube is that:


The first caption appears first and is the first line on the screen.
Then on second 3 the second caption appears as the second line.
On second 7 the first caption disappears and the second caption becomes the first line. At the same time, third caption appears as the second line.




However, when I use the srt in DaVinci Resolve, only a single line appears at a time. So:


The first caption stays there until second 7.
The second caption appears only between seconds 7 and 9.
The third caption appears after second 9.




Is there a way to display such multiline subtitles with DaVinci Resolve?

If not, how do I fix it so it displays properly with one caption at a time?
Given that I couldn't find a satisfying solution, I wrote a Ruby script for merging such overlapping captions.
Usage:
ruby ./merge_overlapping_srt_captions.rb _input_file_ _output_file_