Browse Source

ob-exp: Repair inline code evaluation after last commit.

* lisp/ob-exp.el (org-babel-exp-non-block-elements): Make sure to
  parse inline babel call or inline src block instead of the following
  object.
Nicolas Goaziou 5 years ago
parent
commit
2f4c85e6b4
1 changed files with 7 additions and 1 deletions
  1. 7 1
      lisp/ob-exp.el

+ 7 - 1
lisp/ob-exp.el

@@ -159,7 +159,13 @@ this template."
 		      "\\|" org-babel-lob-one-liner-regexp "\\)")))
       (while (re-search-forward rx end t)
 	(save-excursion
-	  (let* ((element (save-match-data (org-element-context)))
+	  (let* ((element (save-excursion
+			    ;; If match is inline, point is at its
+			    ;; end.  Move backward so
+			    ;; `org-element-context' can get the
+			    ;; object, not the following one.
+			    (backward-char)
+			    (save-match-data (org-element-context))))
 		 (type (org-element-type element)))
 	    (when (memq type '(babel-call inline-babel-call inline-src-block))
 	      (let ((beg-el (org-element-property :begin element))