Browse Source

ob-exp: Escape code when re-creating a src blocks

* lisp/ob-exp.el (org-babel-exp-code): Escape code when re-creating
  a src blocks.
Nicolas Goaziou 12 years ago
parent
commit
78c5838e4e
1 changed files with 2 additions and 2 deletions
  1. 2 2
      lisp/ob-exp.el

+ 2 - 2
lisp/ob-exp.el

@@ -48,7 +48,7 @@
 (declare-function org-element-context "org-element" ())
 (declare-function org-element-property "org-element" (property element))
 (declare-function org-element-type "org-element" (element))
-
+(declare-function org-escape-code-in-string "org-src" (s))
 
 (defcustom org-export-babel-evaluate t
   "Switch controlling code evaluation during export.
@@ -359,7 +359,7 @@ replaced with its value."
   (org-fill-template
    org-babel-exp-code-template
    `(("lang"  . ,(nth 0 info))
-     ("body"  . ,(nth 1 info))
+     ("body"  . ,(org-escape-code-in-string (nth 1 info)))
      ,@(mapcar (lambda (pair)
 		 (cons (substring (symbol-name (car pair)) 1)
 		       (format "%S" (cdr pair))))