Ver código fonte

ox-latex: Fix backslash escaping in plain text

* lisp/ox-latex.el (org-latex-plain-text): Fix backslash escaping.
Nicolas Goaziou 10 anos atrás
pai
commit
5a5e4a5eee
1 arquivos alterados com 3 adições e 3 exclusões
  1. 3 3
      lisp/ox-latex.el

+ 3 - 3
lisp/ox-latex.el

@@ -2228,10 +2228,10 @@ contextual information."
 	     ;; However, if special strings are used, be careful not
 	     ;; to protect "\" in "\-" constructs.
 	     (replace-regexp-in-string
-	      (concat "[%$#&{}_~^]\\|\\\\" (and specialp "\\(?:[^-]\\|$\\)"))
+	      (concat "[%$#&{}_~^]\\|\\\\" (and specialp "\\([^-]\\|$\\)"))
 	      (lambda (m)
-		(case (aref m 0)
-		  (?\\ "$\\\\backslash$")
+		(case (string-to-char m)
+		  (?\\ "$\\\\backslash$\\1")
 		  (?~ "\\\\textasciitilde{}")
 		  (?^ "\\\\^{}")
 		  (t "\\\\\\&")))