瀏覽代碼

ox-latex: Fix links to files with name matching an image type

* lisp/ox-latex.el (org-latex-inline-image-rules): Ensure
caracterization happens on extension only.
Nicolas Goaziou 5 年之前
父節點
當前提交
f4687993c5
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      lisp/ox-latex.el

+ 4 - 4
lisp/ox-latex.el

@@ -738,8 +738,9 @@ environment."
   :safe #'stringp)
 
 (defcustom org-latex-inline-image-rules
-  `(("file" . ,(regexp-opt
-		'("pdf" "jpeg" "jpg" "png" "ps" "eps" "tikz" "pgf" "svg"))))
+  `(("file" . ,(rx "."
+		   (or "pdf" "jpeg" "jpg" "png" "ps" "eps" "tikz" "pgf" "svg")
+		   eos)))
   "Rules characterizing image files that can be inlined into LaTeX.
 
 A rule consists in an association whose key is the type of link
@@ -752,8 +753,7 @@ pdflatex, pdf, jpg and png images are OK.  When processing
 through dvi to Postscript, only ps and eps are allowed.  The
 default we use here encompasses both."
   :group 'org-export-latex
-  :version "24.4"
-  :package-version '(Org . "8.0")
+  :package-version '(Org . "9.4")
   :type '(alist :key-type (string :tag "Type")
 		:value-type (regexp :tag "Path")))