Fix broken regexp.

Julien Barnier writes:

> I recntly noticed that in some specific cases, the final '}' was
> esacped when exproting an emphasis element to LaTeX.
>
> For example, the following element :
>
> /aa/
>
> Is exported to :
>
> \emph{aa\}
>
> This does not append if the string begins with a space or if it
> is ASCII-only. For example, the followig strings are exported
> correctly :
>
> /aaa/
> //
>
> I don't understand why the problem only occurs with non-ASCII chars,
> but I think that the regexp to protect added special chars in the
> org-export-latex-fontify function is missing a '?' in the
> beginning. Tha attached patch corrects it.
This commit is contained in:
Carsten Dominik 2009-12-09 22:34:18 +01:00
parent 0776eab890
commit 0ad032380e
2 changed files with 4 additions and 1 deletions

View File

@ -1,6 +1,9 @@
2009-12-09 Carsten Dominik <carsten.dominik@gmail.com>
* org-latex.el (org-export-latex-make-header): Remove \obeylines.
(org-export-latex-fontify): Fix regexp bug that takes special
care of protecting the right boundary characters in emphasis
matches.
* org.el (org-make-link-regexps): Use John Gruber's regexp for
urls.

View File

@ -1506,7 +1506,7 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
(if (caddr emph)
(setq rpl (org-export-latex-protect-string rpl))
(save-match-data
(if (string-match "\\`.\\(\\\\[a-z]+{\\)\\(.*\\)\\(}\\).?\\'" rpl)
(if (string-match "\\`.?\\(\\\\[a-z]+{\\)\\(.*\\)\\(}\\).?\\'" rpl)
(progn
(add-text-properties (match-beginning 1) (match-end 1)
'(org-protected t) rpl)