From 6deb6247f63f5aaa25550dc0398d50221c5383c1 Mon Sep 17 00:00:00 2001 From: "Thomas F. K. Jorna" Date: Sat, 9 Oct 2021 18:35:39 +0200 Subject: fix: images in preview --- org-roam-ui.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'org-roam-ui.el') 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 "*") -- cgit v1.2.3