1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-11-27 07:37:25 +00:00

Don't error on empty code block body.

* lisp/ob.el (org-babel-parse-src-block-match): Don't error on empty
  code block body.
This commit is contained in:
Eric Schulte 2011-09-13 08:57:29 -06:00
parent dbf0e6d5bc
commit 597e1eb4fe

View File

@ -1021,7 +1021,8 @@ may be specified in the current buffer."
(body (org-babel-clean-text-properties
(let* ((body (match-string 5))
(sub-length (- (length body) 1)))
(if (string= "\n" (substring body sub-length))
(if (and (> sub-length 0)
(string= "\n" (substring body sub-length)))
(substring body 0 sub-length)
body))))
(preserve-indentation (or org-src-preserve-indentation