From f61cd6b7a17507dbcbd96a105d6c2e59a5b087b4 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Mon, 14 Apr 2014 13:47:57 +0200 Subject: [PATCH] Fix mailto links * lisp/ox-html.el (org-html-link): * lisp/ox-latex.el (org-latex-link): * lisp/ox-man.el (org-man-link): * lisp/ox-odt.el (org-odt-link): * contrib/lisp/ox-groff.el (org-groff-link): "mailto" URI do not have an authority part, we do not append "//". --- contrib/lisp/ox-groff.el | 3 ++- lisp/ox-html.el | 6 +++++- lisp/ox-latex.el | 3 ++- lisp/ox-man.el | 3 ++- lisp/ox-odt.el | 3 ++- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/contrib/lisp/ox-groff.el b/contrib/lisp/ox-groff.el index 46be766e4..bd9b8883a 100644 --- a/contrib/lisp/ox-groff.el +++ b/contrib/lisp/ox-groff.el @@ -1251,8 +1251,9 @@ INFO is a plist holding contextual information. See (imagep (org-export-inline-image-p link org-groff-inline-image-rules)) (path (cond - ((member type '("http" "https" "ftp" "mailto")) + ((member type '("http" "https" "ftp")) (concat type "://" raw-path)) + ((string= type "mailto") (concat type ":" raw-path)) ((string= type "file") (if (file-name-absolute-p raw-path) (concat "file://" (expand-file-name raw-path)) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index 9455d6249..3dafb8455 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -2658,7 +2658,11 @@ INFO is a plist holding contextual information. See (desc (org-string-nw-p desc)) (path (cond - ((member type '("http" "https" "ftp" "mailto")) + ((member type '("http" "https" "ftp")) + (org-link-escape + (org-link-unescape + (concat type "://" raw-path)) org-link-escape-chars-browser)) + ((string= type "mailto") (org-link-escape (org-link-unescape (concat type "://" raw-path)) org-link-escape-chars-browser)) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index e70ff0105..3dab06ff7 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -1797,8 +1797,9 @@ INFO is a plist holding contextual information. See (imagep (org-export-inline-image-p link org-latex-inline-image-rules)) (path (cond - ((member type '("http" "https" "ftp" "mailto")) + ((member type '("http" "https" "ftp")) (concat type "://" raw-path)) + ((string= type "mailto") (concat type ":" raw-path)) ((string= type "file") (if (not (file-name-absolute-p raw-path)) raw-path (concat "file://" (expand-file-name raw-path)))) diff --git a/lisp/ox-man.el b/lisp/ox-man.el index 2985a75e3..98a52b06b 100644 --- a/lisp/ox-man.el +++ b/lisp/ox-man.el @@ -645,8 +645,9 @@ INFO is a plist holding contextual information. See (desc (and (not (string= desc "")) desc)) (path (cond - ((member type '("http" "https" "ftp" "mailto")) + ((member type '("http" "https" "ftp")) (concat type "://" raw-path)) + ((string= type "mailto") (concat type ":" raw-path)) ((string= type "file") (if (file-name-absolute-p raw-path) (concat "file://" (expand-file-name raw-path)) diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el index e0f42d2a2..e522ebda0 100644 --- a/lisp/ox-odt.el +++ b/lisp/ox-odt.el @@ -2711,8 +2711,9 @@ INFO is a plist holding contextual information. See (imagep (org-export-inline-image-p link org-odt-inline-image-rules)) (path (cond - ((member type '("http" "https" "ftp" "mailto")) + ((member type '("http" "https" "ftp")) (concat type "://" raw-path)) + ((string= type "mailto") (concat type ":" raw-path)) ((string= type "file") (if (file-name-absolute-p raw-path) (concat "file://" (expand-file-name raw-path)) -- 2.11.4.GIT