sachac / subed

subed is a subtitle editor for Emacs
177 stars 16 forks source link

Fix separator search in subed-srt--validate #23

Closed jun0 closed 3 years ago

jun0 commented 3 years ago

Before this fix, subed-srt--validate was not scanning most of the file. The reason is that [[^\']] matches the literal characters [, ^, \, or ', followed by a ]. The intent was probably to reject end-of-buffer, but that's already handled by the subsequent looking-at.

rndusr commented 3 years ago

Can you add a test for that or explain in English why that's necessary?

I haven't dabbled with elisp in a while and I have no idea what I'm looking at.

jun0 commented 3 years ago

I added a test (speaking of which, some more fix was needed to make tests pass). In a nutshell, the SRT validation code wasn't actually checking anything beyond the first subtitle. It was also not allowing abbreviation of milliseconds, like 00:03:03,45 --> 00:03:15,5 (note there are fewer than 3 characters after the commas).

rndusr commented 3 years ago

Very nice. Thank you.