summaryrefslogtreecommitdiff
path: root/org-roam-ui.el
diff options
context:
space:
mode:
authorThomas F. K. Jorna <[email protected]>2021-10-09 18:35:39 +0200
committerThomas F. K. Jorna <[email protected]>2021-10-09 18:35:39 +0200
commit6deb6247f63f5aaa25550dc0398d50221c5383c1 (patch)
treea04c90d9c26084a6a512308846b63903d4b60d57 /org-roam-ui.el
parent03641ca2868d5ef21ffe426fa547dd859ce1c474 (diff)
fix: images in preview
Diffstat (limited to 'org-roam-ui.el')
-rw-r--r--org-roam-ui.el8
1 files changed, 7 insertions, 1 deletions
diff --git a/org-roam-ui.el b/org-roam-ui.el
index e018b09..8726a76 100644
--- a/org-roam-ui.el
+++ b/org-roam-ui.el
@@ -236,10 +236,16 @@ This serves the web-build and API over HTTP."
(websocket-send-text ws
(json-encode `((type . "orgText") (data . ,text))))))
-(defservlet* note/:id text/plain ()
+(defservlet* file/:file text/plain ()
(progn
(insert-file-contents-literally (org-link-decode file))
(httpd-send-header t "text/plain" 200 :Access-Control-Allow-Origin "*")))
+
+
+(defservlet* img/:file text/plain ()
+ (progn
+ (httpd-send-file t (org-link-decode file))
+(httpd-send-header t "text/plain" 200 :Access-Control-Allow-Origin "*")))
;(insert "error")
;(httpd-send-header t "text/plain" 200 :Access-Control-Allow-Origin "*")