flutter_subtitle_wrapper
flutter_subtitle_wrapper copied to clipboard
Fix SRT text not matched for more than two lines of text
This is a brief regular expression fix to #53 which simplifies the regular expression used to match text for SRT until a blank line is found, following the SRT specification I mentioned in the issue:
It consists of four parts, all in text:
- A number indicating which subtitle it is in the sequence.
- The time that the subtitle appears on the screen, and then disappears.
- The subtitle itself.
- A blank line indicating the start of a new subtitle.
I've tested it on a variety of subtitles I have, but maybe I didn't cover some ground.
Also, just want to add I use a highly modified fork of this in my language learning app and this subtitle wrapper is an essential part of my app's core functionality (I modified it for tap and drag text selection), so I really appreciate this package. I really couldn't have done much if this didn't exist to begin with.
Looks like this doesn't work out for some files. It won't import at all. The following works well, though.
((\d{2}):(\d{2}):(\d{2})\,(\d+)) +--> +((\d{2}):(\d{2}):(\d{2})\,(\d{3})).*[\r\n]+\s*(.*(?:\r?\n(?!\r?\n).*)*)
Going to check this out with some cases, because the test job fails.
Easiest would be if you fix the analytics issues in your code, see the error here: https://github.com/Joran-Dob/flutter_subtitle_wrapper/pull/54/checks?check_run_id=3152131937
yeah... this would also be just dandy to have...