mirror of
https://github.com/org-roam/org-roam
synced 2025-09-16 15:56:48 -05:00
(fix)capture: fill-template preserve whitespace content (#2117)
* (fix)capture: fill-template preserve whitespace content Preserve the whitespace content given in the capture template, by caching it and then appending it to the output template. For Org-capture's purposes, we need to separately ensure that a newline is present. Adds tests to the various helper functions to illustrate changes. Addresses #2115
This commit is contained in:
@@ -69,6 +69,15 @@ Like `string-equal', but case-insensitive."
|
||||
(or (string-equal s1 s2)
|
||||
(string-equal (downcase s1) (downcase s2)))))
|
||||
|
||||
(defun org-roam-whitespace-content (s)
|
||||
"Return the whitespace content at the end of S."
|
||||
(with-temp-buffer
|
||||
(let ((c 0))
|
||||
(insert s)
|
||||
(skip-chars-backward " \t\n")
|
||||
(buffer-substring-no-properties
|
||||
(point) (point-max)))))
|
||||
|
||||
(defun org-roam-strip-comments (s)
|
||||
"Strip Org comments from string S."
|
||||
(with-temp-buffer
|
||||
|
Reference in New Issue
Block a user