Closed felagund closed 10 years ago
Small comment, otherwise it looks good to me.
Yeah, that was my initial version. I am not sure about strapping just any tag: Consider this subtitle:
1
00:00:00,000 --> 00:02:50,435
<odd tag>tag</odd tag>
Mplayer plays it and displays "
So there does not seem to be an agreement what to do with broken tags.
That's my point. SRT is really badly specified. you better strip all tags ever than a whitelist.
Ok, changed as requested.
Still, this hides something like <i some really important subtitle , so I think it would be better to be specific in what we remove, but this really is a corner case:-).
Thanks again for all your PRs!
BTW: is not the commit message too long? Github truncates it.
This ignores tags that srt format allows. It could be done with one regular expression, but I wanted to be explicit in what is ignored (and replace is faster then re, but as it gets called several times, I guess this is overall slower).
SRT is also said to support position coordinates, but there are several ways to write them and I have never actually seen them in the wild, unlike other tags.