소스 검색

ox-beamer: Fix last commit

* lisp/ox-beamer.el (org-beamer-link): Fix commit
  5c28ea6aad2245944bb4f626fe7b039bfbb2b91b.
Nicolas Goaziou 8 년 전
부모
커밋
f747ee43bd
1개의 변경된 파일8개의 추가작업 그리고 7개의 파일을 삭제
  1. 8 7
      lisp/ox-beamer.el

+ 8 - 7
lisp/ox-beamer.el

@@ -721,13 +721,14 @@ channel."
 CONTENTS is the description part of the link.  INFO is a plist
 used as a communication channel."
   (or (org-export-custom-protocol-maybe link contents 'beamer)
-      ;; Fall-back to LaTeX export.  However, if link is becomes
-      ;; a "\hyperlink" macro, try to sneak in Beamer overlay
-      ;; specification, if any.
-      (let ((latex-link (org-export-with-backend 'latex link contents info))
-	    (overlay (org-beamer--element-has-overlay-p link)))
-	(if (and overlay (string-match "\\`\\\\hyperlink" latex-link))
-	    (replace-match (concat "\\&" overlay) nil nil latex-link)
+      ;; Fall-back to LaTeX export.  However, prefer "\hyperlink" over
+      ;; "\hyperref" since the former handles overlay specifications.
+      (let ((latex-link (org-export-with-backend 'latex link contents info)))
+	(if (string-match "\\`\\\\hyperref\\[\\(.*?\\)\\]" latex-link)
+	    (replace-match
+	     (format "\\\\hyperlink%s{\\1}"
+		     (or (org-beamer--element-has-overlay-p link) ""))
+	     nil nil latex-link)
 	  latex-link))))