forked from mirrors/org-mode
better delimiting of Org-mode text preceding a code block
Thanks to Christopher Genovese for this change * lisp/ob-tangle.el (org-babel-tangle-collect-blocks): Better delimiting of Org-mode text preceding a code block.
This commit is contained in:
parent
15a9eac67e
commit
647849dff9
|
@ -358,12 +358,14 @@ code blocks by language."
|
||||||
(buffer-substring
|
(buffer-substring
|
||||||
(max (condition-case nil
|
(max (condition-case nil
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(org-back-to-heading t) (point))
|
(org-back-to-heading t) ; sets match data
|
||||||
(error 0))
|
(match-end 0))
|
||||||
|
(error (point-min)))
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(re-search-backward
|
(if (re-search-backward
|
||||||
org-babel-src-block-regexp nil t)
|
org-babel-src-block-regexp nil t)
|
||||||
(match-end 0)))
|
(match-end 0)
|
||||||
|
(point-min))))
|
||||||
(point)))))
|
(point)))))
|
||||||
by-lang)
|
by-lang)
|
||||||
;; add the spec for this block to blocks under it's language
|
;; add the spec for this block to blocks under it's language
|
||||||
|
|
Loading…
Reference in a new issue