mirror of
https://github.com/org-roam/org-roam
synced 2025-08-01 12:17:21 -05:00
(fix): fix escaping of backslashes in graph generation (#897)
Fixes #884
This commit is contained in:
@ -198,8 +198,10 @@ into a digraph."
|
||||
(`truncate (s-truncate org-roam-graph-max-title-length title))
|
||||
(`wrap (s-word-wrap org-roam-graph-max-title-length title))
|
||||
(_ title)))
|
||||
(shortened-title (org-roam-string-quote shortened-title))
|
||||
(title (org-roam-string-quote title))
|
||||
(node-properties
|
||||
`(("label" . ,(s-replace "\"" "\\\"" shortened-title))
|
||||
`(("label" . ,shortened-title)
|
||||
("URL" . ,(concat "org-protocol://roam-file?file=" (url-hexify-string file)))
|
||||
("tooltip" . ,(xml-escape-string title)))))
|
||||
(insert
|
||||
|
@ -33,6 +33,7 @@
|
||||
;;
|
||||
;;; Code:
|
||||
;;;; Library Requires
|
||||
(require 'dash)
|
||||
|
||||
(defvar org-roam-verbose)
|
||||
|
||||
@ -68,6 +69,12 @@ to look.
|
||||
(when org-roam-verbose
|
||||
(apply #'message `(,(concat "(org-roam) " format-string) ,@args))))
|
||||
|
||||
(defun org-roam-string-quote (str)
|
||||
"Quote STR."
|
||||
(->> str
|
||||
(s-replace "\\" "\\\\")
|
||||
(s-replace "\"" "\\\"")))
|
||||
|
||||
(provide 'org-roam-macs)
|
||||
|
||||
;;; org-roam-macs.el ends here
|
||||
|
Reference in New Issue
Block a user