summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSacha Chua <sacha@sachachua.com>2026-11-12 09:11:29 -0500
committerSacha Chua <sacha@sachachua.com>2026-11-12 09:11:29 -0500
commit0041009df9ea71866cc886599b347c459de9975d (patch)
tree9be9cfd108793f96fca8677f5480fb02a19392e5
parent4ea070ca460fa8470ffe381387d105e52e63b194 (diff)
downloademacsconf-el-0041009df9ea71866cc886599b347c459de9975d.tar.xz
emacsconf-el-0041009df9ea71866cc886599b347c459de9975d.zip
Remove directives
-rw-r--r--emacsconf-subed.el17
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))))