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'.
This commit is contained in:
parent
f85a961c23
commit
e0567c9cac
|
@ -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))
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)))))))
|
||||
|
|
|
@ -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)))
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue