Sfoglia il codice sorgente

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 anni fa
parent
commit
f4687993c5
1 ha cambiato i file con 4 aggiunte e 4 eliminazioni
  1. 4 4
      lisp/ox-latex.el

+ 4 - 4
lisp/ox-latex.el

@@ -738,8 +738,9 @@ environment."
   :safe #'stringp)
   :safe #'stringp)
 
 
 (defcustom org-latex-inline-image-rules
 (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.
   "Rules characterizing image files that can be inlined into LaTeX.
 
 
 A rule consists in an association whose key is the type of link
 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
 through dvi to Postscript, only ps and eps are allowed.  The
 default we use here encompasses both."
 default we use here encompasses both."
   :group 'org-export-latex
   :group 'org-export-latex
-  :version "24.4"
-  :package-version '(Org . "8.0")
+  :package-version '(Org . "9.4")
   :type '(alist :key-type (string :tag "Type")
   :type '(alist :key-type (string :tag "Type")
 		:value-type (regexp :tag "Path")))
 		:value-type (regexp :tag "Path")))