summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2012-10-06 09:19:41 +0200
committerNicolas Goaziou <n.goaziou@gmail.com>2012-10-06 09:19:41 +0200
commit0af2f6068f48f09c4e6feb26e0a72dff869ec7ea (patch)
tree948c5af3e59dbb8a1f942dd08ef93ce1f21b68c0
parent2c78ca4a563fbc1b62413bfab2626ca9e2a86d5d (diff)
downloadorg-mode-0af2f6068f48f09c4e6feb26e0a72dff869ec7ea.tar.gz
org-export: Fix comma escape in included files
* contrib/lisp/org-export.el (org-export-expand-include-keyword): Use new functions to comma escape contents of included files when in an example or a src block.
-rw-r--r--contrib/lisp/org-export.el15
1 files changed, 4 insertions, 11 deletions
diff --git a/contrib/lisp/org-export.el b/contrib/lisp/org-export.el
index 62a18a5..3ef882f 100644
--- a/contrib/lisp/org-export.el
+++ b/contrib/lisp/org-export.el
@@ -2774,23 +2774,16 @@ paths."
(insert
(let ((ind-str (make-string ind ? ))
(contents
- ;; Protect sensitive contents with commas.
- (replace-regexp-in-string
- "\\(^\\)\\([*]\\|[ \t]*#\\+\\)" ","
- (org-export--prepare-file-contents file lines)
- nil nil 1)))
+ (org-escape-code-in-string
+ (org-export--prepare-file-contents file lines))))
(format "%s#+BEGIN_EXAMPLE\n%s%s#+END_EXAMPLE\n"
ind-str contents ind-str))))
((stringp env)
(insert
(let ((ind-str (make-string ind ? ))
(contents
- ;; Protect sensitive contents with commas.
- (replace-regexp-in-string
- (if (string= env "org") "\\(^\\)\\(.\\)"
- "\\(^\\)\\([*]\\|[ \t]*#\\+\\)") ","
- (org-export--prepare-file-contents file lines)
- nil nil 1)))
+ (org-escape-code-in-string
+ (org-export--prepare-file-contents file lines))))
(format "%s#+BEGIN_SRC %s\n%s%s#+END_SRC\n"
ind-str env contents ind-str))))
(t