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

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

[elpa] externals/org bb6830409d: Merge branch 'bugfix'


From: ELPA Syncer
Subject: [elpa] externals/org bb6830409d: Merge branch 'bugfix'
Date: Sat, 26 Feb 2022 04:57:50 -0500 (EST)

branch: externals/org
commit bb6830409d985dd8a443a2e6099980b74166feb2
Merge: 282a01f221 83c6eccaee
Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Commit: Nicolas Goaziou <mail@nicolasgoaziou.fr>

    Merge branch 'bugfix'
---
 lisp/oc-basic.el | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/lisp/oc-basic.el b/lisp/oc-basic.el
index fc71d22fc0..e2dfc06030 100644
--- a/lisp/oc-basic.el
+++ b/lisp/oc-basic.el
@@ -178,21 +178,29 @@ Return a hash table with citation references as keys and 
fields alist as values.
                                      " and ")))
                              ('issued
                               ;; Date are expressed as an array
-                              ;; (`date-parts') or a "string (`raw').
-                              ;; In both cases, extract the year and
-                              ;; associate it to `year' field, for
-                              ;; compatibility with BibTeX format.
+                              ;; (`date-parts') or a "string (`raw'
+                              ;; or `literal'). In both cases,
+                              ;; extract the year and associate it
+                              ;; to `year' field, for compatibility
+                              ;; with BibTeX format.
                               (let ((date (or (alist-get 'date-parts value)
+                                              (alist-get 'literal value)
                                               (alist-get 'raw value))))
                                 (cons 'year
                                       (cond
                                        ((consp date)
                                         (caar date))
                                        ((stringp date)
-                                        (car (split-string date "-")))
+                                        (replace-regexp-in-string
+                                          (rx
+                                            (minimal-match (zero-or-more 
anything))
+                                            (group-n 1 (repeat 4 digit))
+                                            (zero-or-more anything))
+                                          (rx (backref 1))
+                                          date))
                                        (t
                                         (error "Unknown CSL-JSON date format: 
%S"
-                                               date))))))
+                                               value))))))
                              (_
                               (cons field value))))
                          item)



reply via email to

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