mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-09-12 23:39:54 +00:00
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.
This commit is contained in:
parent
2c78ca4a56
commit
0af2f6068f
|
@ -2774,23 +2774,16 @@ paths."
|
||||||
(insert
|
(insert
|
||||||
(let ((ind-str (make-string ind ? ))
|
(let ((ind-str (make-string ind ? ))
|
||||||
(contents
|
(contents
|
||||||
;; Protect sensitive contents with commas.
|
(org-escape-code-in-string
|
||||||
(replace-regexp-in-string
|
(org-export--prepare-file-contents file lines))))
|
||||||
"\\(^\\)\\([*]\\|[ \t]*#\\+\\)" ","
|
|
||||||
(org-export--prepare-file-contents file lines)
|
|
||||||
nil nil 1)))
|
|
||||||
(format "%s#+BEGIN_EXAMPLE\n%s%s#+END_EXAMPLE\n"
|
(format "%s#+BEGIN_EXAMPLE\n%s%s#+END_EXAMPLE\n"
|
||||||
ind-str contents ind-str))))
|
ind-str contents ind-str))))
|
||||||
((stringp env)
|
((stringp env)
|
||||||
(insert
|
(insert
|
||||||
(let ((ind-str (make-string ind ? ))
|
(let ((ind-str (make-string ind ? ))
|
||||||
(contents
|
(contents
|
||||||
;; Protect sensitive contents with commas.
|
(org-escape-code-in-string
|
||||||
(replace-regexp-in-string
|
(org-export--prepare-file-contents file lines))))
|
||||||
(if (string= env "org") "\\(^\\)\\(.\\)"
|
|
||||||
"\\(^\\)\\([*]\\|[ \t]*#\\+\\)") ","
|
|
||||||
(org-export--prepare-file-contents file lines)
|
|
||||||
nil nil 1)))
|
|
||||||
(format "%s#+BEGIN_SRC %s\n%s%s#+END_SRC\n"
|
(format "%s#+BEGIN_SRC %s\n%s%s#+END_SRC\n"
|
||||||
ind-str env contents ind-str))))
|
ind-str env contents ind-str))))
|
||||||
(t
|
(t
|
||||||
|
|
Loading…
Reference in a new issue