emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/subed 340d3f1884 5/9: VTT: Make msecs optional


From: ELPA Syncer
Subject: [nongnu] elpa/subed 340d3f1884 5/9: VTT: Make msecs optional
Date: Tue, 19 Dec 2023 13:00:37 -0500 (EST)

branch: elpa/subed
commit 340d3f18848970c3d041ac507dd789ce9d1425c1
Author: Sacha Chua <sacha@sachachua.com>
Commit: Sacha Chua <sacha@sachachua.com>

    VTT: Make msecs optional
    
    * subed/subed-vtt.el: Make msecs optional.
---
 subed/subed-vtt.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/subed/subed-vtt.el b/subed/subed-vtt.el
index 2c550367d2..4af3b63b2c 100644
--- a/subed/subed-vtt.el
+++ b/subed/subed-vtt.el
@@ -43,7 +43,7 @@
 
 ;;; Parsing
 
-(defconst subed-vtt--regexp-timestamp 
"\\(\\([0-9]+\\):\\)?\\([0-9]+\\):\\([0-9]+\\)\\.\\([0-9]+\\)")
+(defconst subed-vtt--regexp-timestamp 
"\\(\\([0-9]+\\):\\)?\\([0-9]+\\):\\([0-9]+\\)\\(?:\\.\\([0-9]+\\)\\)?")
 (defconst subed-vtt--regexp-separator "\\(?:[[:blank:]]*\n\\)+\\(?:NOTE[ 
\n]\\(?:.+?\n\\)+\n\\)*\n")
 (defconst subed-vtt--regexp-identifier
   ;; According to https://developer.mozilla.org/en-US/docs/Web/API/WebVTT_API
@@ -59,7 +59,7 @@ Use the format-specific function for MAJOR-MODE."
     (let ((hours (string-to-number (or (match-string 2 time-string) "0")))
           (mins  (string-to-number (match-string 3 time-string)))
           (secs  (string-to-number (match-string 4 time-string)))
-          (msecs (string-to-number (subed--right-pad (match-string 5 
time-string) 3 ?0))))
+          (msecs (string-to-number (subed--right-pad (or (match-string 5 
time-string) "0")  3 ?0))))
       (+ (* (truncate hours) 3600000)
          (* (truncate mins) 60000)
          (* (truncate secs) 1000)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]