branch: elpa/subed commit 1c8e0d11c0791184585ccfc4eb2d55dbcac6bb18 Author: Random User <rnd...@posteo.de> Commit: Random User <rnd...@posteo.de>
Sanitize separator between start and stop time --- subed/subed-srt.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/subed/subed-srt.el b/subed/subed-srt.el index d4dfd12..be301f1 100644 --- a/subed/subed-srt.el +++ b/subed/subed-srt.el @@ -495,7 +495,14 @@ each subtitle." (goto-char (point-max)) (subed-srt-move-to-subtitle-end) (when (looking-at "\n*") - (replace-match "\n")))))) + (replace-match "\n")) + + ;; Ensure there is one space before and after " --> " + (goto-char (point-min)) + (while (re-search-forward (format "^%s" subed-srt--regexp-timestamp) nil t) + (when (looking-at "[[:blank:]]*-->[[:blank:]]*") + (unless (= (length (match-string 0)) 5) + (replace-match " --> ")))))))) (defun subed-srt-validate () "Move point to the first invalid subtitle and report an error."