From b4768baf2c6ea234c92f24540ed927cf8473e999 Mon Sep 17 00:00:00 2001 From: Jay Kamat Date: Sat, 5 Aug 2017 19:14:44 -0700 Subject: [PATCH] ox-md.el: Fix exporting of remote image links * lisp/ox-md.el (org-md-link): Check if a link is a remote, and if so, use the raw-link property of the link, rather than the path. A workaround for this bug is to do this: [[file:http://orgmode.org/img/org-mode-unicorn-logo.png]] This commit lets the workaround continue working, while the proper method: [[http://orgmode.org/img/org-mode-unicorn-logo.png]] is fixed. --- lisp/ox-md.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/ox-md.el b/lisp/ox-md.el index 08e3852823..a4e1d6749b 100644 --- a/lisp/ox-md.el +++ b/lisp/ox-md.el @@ -430,8 +430,14 @@ a communication channel." (format "[%s](#%s)" description (org-export-get-reference destination info)))))))) + ;; Generate a md image link ((org-export-inline-image-p link org-html-inline-image-rules) - (let ((path (let ((raw-path (org-element-property :path link))) + ;; Get the path and caption to insert into the image + (let ((path (let ((raw-path + ;; types of links which we just use the raw link + (if (member type '("http" "https" "ftp")) + (org-element-property :raw-link link) + (org-element-property :path link)))) (if (not (file-name-absolute-p raw-path)) raw-path (expand-file-name raw-path)))) (caption (org-export-data -- 2.11.0