瀏覽代碼

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 "//".
Nicolas Goaziou 11 年之前
父節點
當前提交
f61cd6b7a1
共有 5 個文件被更改,包括 13 次插入5 次删除
  1. 2 1
      contrib/lisp/ox-groff.el
  2. 5 1
      lisp/ox-html.el
  3. 2 1
      lisp/ox-latex.el
  4. 2 1
      lisp/ox-man.el
  5. 2 1
      lisp/ox-odt.el

+ 2 - 1
contrib/lisp/ox-groff.el

@@ -1251,8 +1251,9 @@ INFO is a plist holding contextual information.  See
          (imagep (org-export-inline-image-p
          (imagep (org-export-inline-image-p
                   link org-groff-inline-image-rules))
                   link org-groff-inline-image-rules))
          (path (cond
          (path (cond
-                ((member type '("http" "https" "ftp" "mailto"))
+                ((member type '("http" "https" "ftp"))
                  (concat type "://" raw-path))
                  (concat type "://" raw-path))
+		((string= type "mailto") (concat type ":" raw-path))
                 ((string= type "file")
                 ((string= type "file")
                  (if (file-name-absolute-p raw-path)
                  (if (file-name-absolute-p raw-path)
                      (concat "file://" (expand-file-name raw-path))
                      (concat "file://" (expand-file-name raw-path))

+ 5 - 1
lisp/ox-html.el

@@ -2658,7 +2658,11 @@ INFO is a plist holding contextual information.  See
 	 (desc (org-string-nw-p desc))
 	 (desc (org-string-nw-p desc))
 	 (path
 	 (path
 	  (cond
 	  (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-escape
 	     (org-link-unescape
 	     (org-link-unescape
 	      (concat type "://" raw-path)) org-link-escape-chars-browser))
 	      (concat type "://" raw-path)) org-link-escape-chars-browser))

+ 2 - 1
lisp/ox-latex.el

@@ -1797,8 +1797,9 @@ INFO is a plist holding contextual information.  See
 	 (imagep (org-export-inline-image-p
 	 (imagep (org-export-inline-image-p
 		  link org-latex-inline-image-rules))
 		  link org-latex-inline-image-rules))
 	 (path (cond
 	 (path (cond
-		((member type '("http" "https" "ftp" "mailto"))
+		((member type '("http" "https" "ftp"))
 		 (concat type "://" raw-path))
 		 (concat type "://" raw-path))
+		((string= type "mailto") (concat type ":" raw-path))
 		((string= type "file")
 		((string= type "file")
 		 (if (not (file-name-absolute-p raw-path)) raw-path
 		 (if (not (file-name-absolute-p raw-path)) raw-path
 		   (concat "file://" (expand-file-name raw-path))))
 		   (concat "file://" (expand-file-name raw-path))))

+ 2 - 1
lisp/ox-man.el

@@ -645,8 +645,9 @@ INFO is a plist holding contextual information.  See
          (desc (and (not (string= desc "")) desc))
          (desc (and (not (string= desc "")) desc))
 
 
          (path (cond
          (path (cond
-                ((member type '("http" "https" "ftp" "mailto"))
+                ((member type '("http" "https" "ftp"))
                  (concat type "://" raw-path))
                  (concat type "://" raw-path))
+		((string= type "mailto") (concat type ":" raw-path))
                 ((string= type "file")
                 ((string= type "file")
                  (if (file-name-absolute-p raw-path)
                  (if (file-name-absolute-p raw-path)
                      (concat "file://" (expand-file-name raw-path))
                      (concat "file://" (expand-file-name raw-path))

+ 2 - 1
lisp/ox-odt.el

@@ -2711,8 +2711,9 @@ INFO is a plist holding contextual information.  See
 	 (imagep (org-export-inline-image-p
 	 (imagep (org-export-inline-image-p
 		  link org-odt-inline-image-rules))
 		  link org-odt-inline-image-rules))
 	 (path (cond
 	 (path (cond
-		((member type '("http" "https" "ftp" "mailto"))
+		((member type '("http" "https" "ftp"))
 		 (concat type "://" raw-path))
 		 (concat type "://" raw-path))
+		((string= type "mailto") (concat type ":" raw-path))
 		((string= type "file")
 		((string= type "file")
 		 (if (file-name-absolute-p raw-path)
 		 (if (file-name-absolute-p raw-path)
 		     (concat "file://" (expand-file-name raw-path))
 		     (concat "file://" (expand-file-name raw-path))