mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-12-28 10:56:57 +00:00
ob-tangle: Correctly unescape code when tangling
* lisp/ob-tangle.el (org-babel-spec-to-string): Use dedicated function for unescaping code.
This commit is contained in:
parent
2c797c41d9
commit
8ef19cdeee
@ -309,12 +309,12 @@ references."
|
||||
(defvar org-bracket-link-regexp)
|
||||
(defun org-babel-spec-to-string (spec)
|
||||
"Insert SPEC into the current file.
|
||||
Insert the source-code specified by SPEC into the current
|
||||
source code file. This function uses `comment-region' which
|
||||
assumes that the appropriate major-mode is set. SPEC has the
|
||||
form
|
||||
|
||||
(start-line file link source-name params body comment)"
|
||||
Insert the source-code specified by SPEC into the current source
|
||||
code file. This function uses `comment-region' which assumes
|
||||
that the appropriate major-mode is set. SPEC has the form:
|
||||
|
||||
\(start-line file link source-name params body comment)"
|
||||
(let* ((start-line (nth 0 spec))
|
||||
(file (nth 1 spec))
|
||||
(link (nth 2 spec))
|
||||
@ -346,8 +346,7 @@ form
|
||||
(insert
|
||||
(format
|
||||
"%s\n"
|
||||
(replace-regexp-in-string
|
||||
"^," ""
|
||||
(org-unescape-code-in-string
|
||||
(org-babel-trim body (if org-src-preserve-indentation "[\f\n\r\v]")))))
|
||||
(when link-p
|
||||
(funcall
|
||||
|
Loading…
Reference in New Issue
Block a user