diff options
author | Joost Kremers <joostkremers@fastmail.fm> | 2021-05-06 17:42:48 +0200 |
---|---|---|
committer | Joost Kremers <joostkremers@fastmail.fm> | 2021-05-06 17:42:48 +0200 |
commit | 0e075917e3c73c7da80e6d5e1119c149fd447b82 (patch) | |
tree | 47b389aa8dc058ce7a3334d3bcdc83be4d6b5054 /parsebib.el | |
parent | 25f66ce2e529fa16af57de0921abc9cb3c0838bb (diff) |
Add some comments and empty lines to parsebib-stringify-json-field
Diffstat (limited to 'parsebib.el')
-rw-r--r-- | parsebib.el | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/parsebib.el b/parsebib.el index fd1db42..ce33cfd 100644 --- a/parsebib.el +++ b/parsebib.el @@ -787,14 +787,24 @@ string." (cond ((stringp value) value) + ((numberp value) (format "%s" value)) + ((memq key parsebib-json-name-fields) (parsebib--json-stringify-name-field value)) + ((memq key parsebib-json-date-fields) (parsebib--json-stringify-date-field value)) + + ;; In CSL-JSON v1.0, the only array field besides name and date fields + ;; is "categories". It has an array of strings as value, so the `format' + ;; isn't strictly necessary. We do it this way just to be on the safe + ;; side. ((arrayp value) (mapconcat (lambda (e) (format "%s" e)) value parsebib-json-field-separator)) + + ;; This clause should never be reached. (t (replace-regexp-in-string "\n" " " (format "%s" value)))))) (defun parsebib--json-stringify-name-field (names) |