diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2015-04-20 12:37:13 +0200 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2015-04-20 12:37:13 +0200 |
commit | e0567c9cacc3a13d21a24ba3058d653a335ae9cb (patch) | |
tree | ea45e6201b22673c71993c3ff03da352741dffeb | |
parent | f85a961c2306755b544dac00549f798410e0aa88 (diff) | |
download | org-mode-e0567c9cacc3a13d21a24ba3058d653a335ae9cb.tar.gz |
Export back-ends: Use `org-export-file-uri'
* contrib/lisp/ox-groff.el (org-groff-link):
* lisp/ox-html.el (org-html-link):
* lisp/ox-latex.el (org-latex-link):
* lisp/ox-man.el (org-man-link):
* lisp/ox-md.el (org-md-link):
* lisp/ox-odt.el (org-odt-link):
* lisp/ox-texinfo.el (org-texinfo-link): Use `org-export-file-uri'.
-rw-r--r-- | contrib/lisp/ox-groff.el | 3 | ||||
-rw-r--r-- | lisp/ox-html.el | 4 | ||||
-rw-r--r-- | lisp/ox-latex.el | 3 | ||||
-rw-r--r-- | lisp/ox-man.el | 3 | ||||
-rw-r--r-- | lisp/ox-md.el | 6 | ||||
-rw-r--r-- | lisp/ox-odt.el | 3 | ||||
-rw-r--r-- | lisp/ox-texinfo.el | 3 |
7 files changed, 8 insertions, 17 deletions
diff --git a/contrib/lisp/ox-groff.el b/contrib/lisp/ox-groff.el index 96ead87..ade3478 100644 --- a/contrib/lisp/ox-groff.el +++ b/contrib/lisp/ox-groff.el @@ -1252,8 +1252,7 @@ INFO is a plist holding contextual information. See (path (cond ((member type '("http" "https" "ftp" "mailto")) (concat type ":" raw-path)) - ((and (string= type "file") (file-name-absolute-p raw-path)) - (concat "file://" raw-path)) + ((string= type "file") (org-export-file-uri raw-path)) (t raw-path)))) (cond ((org-export-custom-protocol-maybe link desc 'groff)) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index 76afcd6..52618c8 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -2839,10 +2839,10 @@ INFO is a plist holding contextual information. See (setq raw-path (funcall link-org-files-as-html-maybe raw-path info)) ;; If file path is absolute, prepend it with protocol - ;; component - "file:". + ;; component - "file://". (cond ((file-name-absolute-p raw-path) - (setq raw-path (concat "file:" raw-path))) + (setq raw-path (org-export-file-uri raw-path))) ((and home use-abs-url) (setq raw-path (concat (file-name-as-directory home) raw-path)))) ;; Add search option, if any. A search option can be diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index ace7745..2727f1c 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -2079,8 +2079,7 @@ INFO is a plist holding contextual information. See (path (cond ((member type '("http" "https" "ftp" "mailto" "doi")) (concat type ":" raw-path)) - ((and (string= type "file") (file-name-absolute-p raw-path)) - (concat "file:" raw-path)) + ((string= type "file") (org-export-file-uri raw-path)) (t raw-path)))) (cond ;; Link type is handled by a special function. diff --git a/lisp/ox-man.el b/lisp/ox-man.el index e95c8b5..6388a55 100644 --- a/lisp/ox-man.el +++ b/lisp/ox-man.el @@ -651,8 +651,7 @@ INFO is a plist holding contextual information. See (path (cond ((member type '("http" "https" "ftp" "mailto")) (concat type ":" raw-path)) - ((and (string= type "file") (file-name-absolute-p raw-path)) - (concat "file:" raw-path)) + ((string= type "file") (org-export-file-uri raw-path)) (t raw-path))) protocol) (cond diff --git a/lisp/ox-md.el b/lisp/ox-md.el index b3fb10f..e4291e5 100644 --- a/lisp/ox-md.el +++ b/lisp/ox-md.el @@ -362,11 +362,7 @@ a communication channel." ((member type '("http" "https" "ftp")) (concat type ":" raw-path)) ((string= type "file") - (let ((path (funcall link-org-files-as-md raw-path))) - (if (not (file-name-absolute-p path)) path - ;; If file path is absolute, prepend it - ;; with "file:" component. - (concat "file:" path)))) + (org-export-file-uri (funcall link-org-files-as-md raw-path))) (t raw-path)))) (if (not contents) (format "<%s>" path) (format "[%s](%s)" contents path))))))) diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el index 9e31468..a8544a4 100644 --- a/lisp/ox-odt.el +++ b/lisp/ox-odt.el @@ -2747,8 +2747,7 @@ INFO is a plist holding contextual information. See (path (cond ((member type '("http" "https" "ftp" "mailto")) (concat type ":" raw-path)) - ((and (string= type "file") (file-name-absolute-p raw-path)) - (concat "file:" raw-path)) + ((string= type "file") (org-export-file-uri raw-path)) (t raw-path))) ;; Convert & to & for correct XML representation (path (replace-regexp-in-string "&" "&" path))) diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el index ac7cbe3..dd15ba0 100644 --- a/lisp/ox-texinfo.el +++ b/lisp/ox-texinfo.el @@ -909,8 +909,7 @@ INFO is a plist holding contextual information. See (path (cond ((member type '("http" "https" "ftp")) (concat type ":" raw-path)) - ((and (string= type "file") (file-name-absolute-p raw-path)) - (concat "file:" raw-path)) + ((string= type "file") (org-export-file-uri raw-path)) (t raw-path)))) (cond ((org-export-custom-protocol-maybe link desc 'texinfo)) |