diff options
| -rw-r--r-- | emacsconf-subed.el | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/emacsconf-subed.el b/emacsconf-subed.el index 32d655d..95d95e3 100644 --- a/emacsconf-subed.el +++ b/emacsconf-subed.el @@ -176,14 +176,15 @@ TYPE can be 'end if you want the match end instead of the beginning." (let (result current) (mapc (lambda (o) - (if (not (string= (or (elt o 4) "") "")) - (progn - (when current (setq result (cons current result))) - (setq current - (list nil (elt o 1) (elt o 2) - (string-trim (replace-regexp-in-string "^NOTE[ \n]+\\|[ \n]+" " " (elt o 4)))))) - ;; update the end time to include the current subtitle - (when current (setf (elt current 2) (elt o 2))))) + (let ((comment (subed-record-remove-directives (elt o 4)))) + (if (not (string= (or comment "") "")) + (progn + (when current (setq result (cons current result))) + (setq current + (list nil (elt o 1) (elt o 2) + (string-trim comment)))) + ;; update the end time to include the current subtitle + (when current (setf (elt current 2) (elt o 2)))))) subtitles) (nreverse (cons current result)))) |
