Ver Fonte

Fix link export

* 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):
* lisp/ox-texinfo.el (org-texinfo-link): Append "//" after some link
  types.

* lisp/ox-md.el (org-md-link):
* contrib/lisp/ox-groff.el (org-groff-link): Ditto.  Also remove some
  unused code, as search options are already stripped out link's path.

Since 3589f64e42dfbc894e789c2a9fba530eac36c665, Org ignores "//" in
a link type so it has to be re-introduced upon exporting.
Nicolas Goaziou há 11 anos atrás
pai
commit
fc1f7d752f
7 ficheiros alterados com 7 adições e 11 exclusões
  1. 1 3
      contrib/lisp/ox-groff.el
  2. 1 1
      lisp/ox-html.el
  3. 1 1
      lisp/ox-latex.el
  4. 1 3
      lisp/ox-man.el
  5. 1 1
      lisp/ox-md.el
  6. 1 1
      lisp/ox-odt.el
  7. 1 1
      lisp/ox-texinfo.el

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

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

+ 1 - 1
lisp/ox-html.el

@@ -2661,7 +2661,7 @@ INFO is a plist holding contextual information.  See
 	   ((member type '("http" "https" "ftp" "mailto"))
 	    (org-link-escape
 	     (org-link-unescape
-	      (concat type ":" raw-path)) org-link-escape-chars-browser))
+	      (concat type "://" raw-path)) org-link-escape-chars-browser))
 	   ((string= type "file")
 	    ;; Treat links to ".org" files as ".html", if needed.
 	    (setq raw-path

+ 1 - 1
lisp/ox-latex.el

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

+ 1 - 3
lisp/ox-man.el

@@ -646,10 +646,8 @@ INFO is a plist holding contextual information.  See
 
          (path (cond
                 ((member type '("http" "https" "ftp" "mailto"))
-                 (concat type ":" raw-path))
+                 (concat type "://" raw-path))
                 ((string= type "file")
-                 (when (string-match "\\(.+\\)::.+" raw-path)
-                   (setq raw-path (match-string 1 raw-path)))
                  (if (file-name-absolute-p raw-path)
                      (concat "file://" (expand-file-name raw-path))
                    (concat "file://" raw-path)))

+ 1 - 1
lisp/ox-md.el

@@ -320,7 +320,7 @@ a communication channel."
 		    (path
 		     (cond
 		      ((member type '("http" "https" "ftp"))
-		       (concat type ":" raw-path))
+		       (concat type "://" raw-path))
 		      ((equal type "file")
 		       (let ((path (funcall link-org-files-as-md raw-path)))
 			 (if (not (file-name-absolute-p path)) path

+ 1 - 1
lisp/ox-odt.el

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

+ 1 - 1
lisp/ox-texinfo.el

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