mirror of
https://github.com/org-roam/org-roam
synced 2025-08-01 12:17:21 -05:00
(fix): fix get-backlinks failing for unescaped strings (#1008)
Revert to emacsql vector format to retain escaping. Fixes #1007. Co-authored-by: Leo Vivier <leo.vivier+dev@gmail.com>
This commit is contained in:
@ -37,6 +37,15 @@
|
|||||||
|
|
||||||
(defvar org-roam-verbose)
|
(defvar org-roam-verbose)
|
||||||
|
|
||||||
|
;;;; Utility Functions
|
||||||
|
(defun org-roam--list-interleave (lst separator)
|
||||||
|
"Interleaves elements in LST with SEPARATOR."
|
||||||
|
(when lst
|
||||||
|
(let ((new-lst (list (pop lst))))
|
||||||
|
(dolist (it lst)
|
||||||
|
(nconc new-lst (list separator it)))
|
||||||
|
new-lst)))
|
||||||
|
|
||||||
(defmacro org-roam--with-temp-buffer (file &rest body)
|
(defmacro org-roam--with-temp-buffer (file &rest body)
|
||||||
"Execute BODY within a temp buffer.
|
"Execute BODY within a temp buffer.
|
||||||
Like `with-temp-buffer', but propagates `org-roam-directory'.
|
Like `with-temp-buffer', but propagates `org-roam-directory'.
|
||||||
|
11
org-roam.el
11
org-roam.el
@ -1013,11 +1013,12 @@ Org-roam cache. It may be a file, for Org-roam file links, or a
|
|||||||
citation key, for Org-ref cite links."
|
citation key, for Org-ref cite links."
|
||||||
(unless (listp targets)
|
(unless (listp targets)
|
||||||
(setq targets (list targets)))
|
(setq targets (list targets)))
|
||||||
(org-roam-db-query
|
(let ((conditions (--> targets
|
||||||
(concat "SELECT \"from\", \"to\", \"properties\" FROM links WHERE "
|
(mapcar (lambda (i) (list '= 'to i)) it)
|
||||||
(string-join (mapcar (lambda (target)
|
(org-roam--list-interleave it :or))))
|
||||||
(concat "\"to\" = '\"" target "\"'"))
|
(org-roam-db-query `[:select [from to properties] :from links
|
||||||
targets) " OR "))))
|
:where ,@conditions
|
||||||
|
:order-by (asc from)])))
|
||||||
|
|
||||||
(defun org-roam-store-link ()
|
(defun org-roam-store-link ()
|
||||||
"Store a link to an Org-roam file or heading."
|
"Store a link to an Org-roam file or heading."
|
||||||
|
Reference in New Issue
Block a user