summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2019-02-20 15:26:27 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2019-02-20 15:26:27 +0100
commit0f70354b3200a55d45d463a1cbc063615eaab53a (patch)
tree700af16bd80dd7a1761dfa2975d73006ca40070d
parent6a9e847dec3b7bd00b5451fad14310c17edf022e (diff)
downloadorg-mode-0f70354b3200a55d45d463a1cbc063615eaab53a.tar.gz
ox: Add missing `org-link-unescape' calls
* lisp/ox-ascii.el (org-ascii-link): * lisp/ox-latex.el (org-latex--inline-image): (org-latex-link): Add missing `org-link-unescape' to handle hex-escaped URI. Reported-by: stardiviner <numbchild@gmail.com> <http://lists.gnu.org/r/emacs-orgmode/2019-02/msg00265.html>
-rw-r--r--lisp/ox-ascii.el3
-rw-r--r--lisp/ox-latex.el8
2 files changed, 7 insertions, 4 deletions
diff --git a/lisp/ox-ascii.el b/lisp/ox-ascii.el
index ae95ed9..14a2646 100644
--- a/lisp/ox-ascii.el
+++ b/lisp/ox-ascii.el
@@ -1600,7 +1600,8 @@ INFO is a plist holding contextual information."
;; Don't know what to do. Signal it.
(_ "???"))))
(t
- (let ((raw-link (org-element-property :raw-link link)))
+ (let ((raw-link (org-link-unescape
+ (org-element-property :raw-link link))))
(if (not (org-string-nw-p desc)) (format "<%s>" raw-link)
(concat (format "[%s]" desc)
(and (not (plist-get info :ascii-links-to-notes))
diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index d8fd055..813f6d0 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -2344,7 +2344,8 @@ CONTENTS is nil. INFO is a plist holding contextual information."
LINK is the link pointing to the inline image. INFO is a plist
used as a communication channel."
(let* ((parent (org-export-get-parent-element link))
- (path (let ((raw-path (org-element-property :path link)))
+ (path (let ((raw-path (org-link-unescape
+ (org-element-property :path link))))
(if (not (file-name-absolute-p raw-path)) raw-path
(expand-file-name raw-path))))
(filetype (file-name-extension path))
@@ -2500,7 +2501,8 @@ INFO is a plist holding contextual information. See
(path (org-latex--protect-text
(cond ((member type '("http" "https" "ftp" "mailto" "doi"))
(concat type ":" raw-path))
- ((string= type "file") (org-export-file-uri raw-path))
+ ((string= type "file")
+ (org-export-file-uri (org-link-unescape raw-path)))
(t raw-path)))))
(cond
;; Link type is handled by a special function.
@@ -2556,7 +2558,7 @@ INFO is a plist holding contextual information. See
(format (org-export-get-coderef-format path desc)
(org-export-resolve-coderef path info)))
;; External link with a description part.
- ((and path desc) (format "\\href{%s}{%s}" path desc))
+ ((and path desc) (format "\\href{%s}{%s}" (org-link-unescape path) desc))
;; External link without a description part.
(path (format "\\url{%s}" path))
;; No path, only description. Try to do something useful.