Browse Source

LaTeX export: Fix protection bug

Sebastian Rose writes:

> The following code does not work as expected, when exported to PDF:
>
> => --->8----------------------------->8----------------------------->8---
> * Image basics
>
>  Images are inserted into an Org file in a fashion similar to links:
>  : [[file:///home/sebastian/develop/org/org-mode-unicorn.png]]
>
> <= ---8<-----------------------------8<-----------------------------8<---
>
> Result:
>
>  The last line is exported as:
>
>  \href{file:///home/sebastian/develop/org/org-mode-unicorn.png}{nil}
>
>
> Expected result:
>
>  I expect the last line to be exported as fixed width text.
>
Carsten Dominik 15 years ago
parent
commit
80b81a168e
2 changed files with 4 additions and 1 deletions
  1. 3 0
      lisp/ChangeLog
  2. 1 1
      lisp/org-latex.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2009-11-10  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-latex.el (org-export-latex-links): Check for protectedness
+	in the last matched character, not after the match.
+
 	* org-datetree.el (org-datetree-find-date-create): Respect
 	restriction when KEEP-RESTRICTION is set.
 	(org-datetree-file-entry-under): New function.

+ 1 - 1
lisp/org-latex.el

@@ -1536,7 +1536,7 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
   "Convert links to LaTeX."
   (goto-char (point-min))
   (while (re-search-forward org-bracket-link-analytic-regexp++ nil t)
-    (org-if-unprotected
+    (org-if-unprotected-1
      (goto-char (match-beginning 0))
      (let* ((re-radio org-export-latex-all-targets-re)
 	    (remove (list (match-beginning 0) (match-end 0)))