浏览代码

don't try to evaluate #+call lines in verbatim blocks

* lisp/ob-exp.el (org-babel-exp-lob-one-liners): Don't limit
  in-verbatim check to inline code blocks, do lob code blocks as well.
* testing/lisp/test-ob-lob.el (test-ob-lob/do-not-eval-lob-lines-in-example-blocks-on-export):
  Test ensuring that #+call lines in verbatim blocks are not evaluated
Eric Schulte 13 年之前
父节点
当前提交
f55810593e
共有 2 个文件被更改,包括 9 次插入1 次删除
  1. 1 1
      lisp/ob-exp.el
  2. 8 0
      testing/lisp/test-ob-lob.el

+ 1 - 1
lisp/ob-exp.el

@@ -184,7 +184,7 @@ options are taken from `org-babel-default-header-args'."
     (goto-char start)
     (while (and (< (point) end)
 		(re-search-forward org-babel-lob-one-liner-regexp nil t))
-      (unless (and (match-string 12) (org-babel-in-example-or-verbatim))
+      (unless (org-babel-in-example-or-verbatim)
 	(let* ((lob-info (org-babel-lob-get-info))
 	       (inlinep (match-string 11))
 	       (inline-start (match-end 11))

+ 8 - 0
testing/lisp/test-ob-lob.el

@@ -94,6 +94,14 @@
 	;; 10 should export
 	(should (re-search-forward "10" nil t))))))
 
+(ert-deftest test-ob-lob/do-not-eval-lob-lines-in-example-blocks-on-export ()
+  (org-test-with-temp-text-in-file "
+for export
+#+begin_example
+#+call: rubbish()
+#+end_example"
+    (org-export-as-html nil)))
+
 (provide 'test-ob-lob)
 
 ;;; test-ob-lob.el ends here