mirror of
https://github.com/protesilaos/denote.git
synced 2026-09-10 07:16:20 -04:00
Do not check type in denote-format-string-for-{org/md}-front-matter
This commit is contained in:
parent
b69736209c
commit
acad7c3577
10
denote.el
10
denote.el
|
|
@ -1464,12 +1464,9 @@ Change the front matter format'.")
|
|||
|
||||
(defun denote-format-string-for-md-front-matter (s)
|
||||
"Surround string S with quotes.
|
||||
If S is not a string, return a literal emptry string.
|
||||
|
||||
This can be used in `denote-file-types' to format front mattter."
|
||||
(if (stringp s)
|
||||
(format "%S" s)
|
||||
"\"\""))
|
||||
(format "%S" s))
|
||||
|
||||
(defun denote-trim-whitespace (s)
|
||||
"Trim whitespace around string S.
|
||||
|
|
@ -1487,9 +1484,8 @@ This can be used in `denote-file-types' to format front mattter."
|
|||
(denote--trim-quotes (denote-trim-whitespace s)))
|
||||
|
||||
(defun denote-format-string-for-org-front-matter (s)
|
||||
"Return string S as-is for Org or plain text front matter.
|
||||
If S is not a string, return an empty string."
|
||||
(if (stringp s) s ""))
|
||||
"Return string S as-is for Org or plain text front matter."
|
||||
s)
|
||||
|
||||
(defun denote-format-keywords-for-md-front-matter (keywords)
|
||||
"Format front matter KEYWORDS for markdown file type.
|
||||
|
|
|
|||
|
|
@ -173,10 +173,7 @@ Extend what we do in `denote-test--denote-file-type-extensions'."
|
|||
(ert-deftest denote-test--denote-surround-with-quotes ()
|
||||
"Test that `denote-surround-with-quotes' returns a string in quotes."
|
||||
(should (and (equal (denote-surround-with-quotes "test") "\"test\"")
|
||||
(equal (denote-surround-with-quotes "") "\"\"")
|
||||
(equal (denote-surround-with-quotes nil) "\"\"")
|
||||
(equal (denote-surround-with-quotes 'wrong) "\"\"")
|
||||
(equal (denote-surround-with-quotes '(wrong)) "\"\""))))
|
||||
(equal (denote-surround-with-quotes "") "\"\""))))
|
||||
|
||||
(ert-deftest denote-test--denote--format-front-matter ()
|
||||
"Test that `denote--format-front-matter' formats front matter correctly."
|
||||
|
|
|
|||
Loading…
Reference in a new issue