forked from mirrors/org-mode
don't always replace <<noweb>> references when :exports both
* lisp/ob-exp.el (org-babel-exp-results): Alter a copy of info. * testing/examples/babel.org (an): Example data for test behavior. * testing/lisp/test-ob-exp.el (ob-exp/noweb-no-export-and-exports-both): Confirm proper behavior.
This commit is contained in:
parent
bf1d5cfe95
commit
94f10ddfd7
|
@ -251,7 +251,8 @@ inhibit insertion of results into the buffer."
|
||||||
(when (and org-export-babel-evaluate
|
(when (and org-export-babel-evaluate
|
||||||
(not (and hash (equal hash (org-babel-current-result-hash)))))
|
(not (and hash (equal hash (org-babel-current-result-hash)))))
|
||||||
(let ((lang (nth 0 info))
|
(let ((lang (nth 0 info))
|
||||||
(body (nth 1 info)))
|
(body (nth 1 info))
|
||||||
|
(info (copy-sequence info)))
|
||||||
;; skip code blocks which we can't evaluate
|
;; skip code blocks which we can't evaluate
|
||||||
(when (fboundp (intern (concat "org-babel-execute:" lang)))
|
(when (fboundp (intern (concat "org-babel-execute:" lang)))
|
||||||
(org-babel-eval-wipe-error-buffer)
|
(org-babel-eval-wipe-error-buffer)
|
||||||
|
|
|
@ -288,3 +288,22 @@ exporting a code block with a name
|
||||||
#+begin_src sh :foo "baz"
|
#+begin_src sh :foo "baz"
|
||||||
echo bar
|
echo bar
|
||||||
#+end_src
|
#+end_src
|
||||||
|
* noweb no-export and exports both
|
||||||
|
:PROPERTIES:
|
||||||
|
:ID: 8a820f6c-7980-43db-8a24-0710d33729c9
|
||||||
|
:END:
|
||||||
|
Weird interaction.
|
||||||
|
|
||||||
|
here is one block
|
||||||
|
|
||||||
|
#+name: noweb-no-export-and-exports-both-1
|
||||||
|
#+BEGIN_SRC sh :exports none
|
||||||
|
echo 1
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
and another
|
||||||
|
|
||||||
|
#+BEGIN_SRC sh :noweb no-export :exports both
|
||||||
|
# I am inside the code block
|
||||||
|
<<noweb-no-export-and-exports-both-1>>
|
||||||
|
#+END_SRC
|
||||||
|
|
|
@ -217,6 +217,13 @@ elements in the final html."
|
||||||
(should (string-match "baz" ascii))
|
(should (string-match "baz" ascii))
|
||||||
(should (string-match "replace" ascii))))))
|
(should (string-match "replace" ascii))))))
|
||||||
|
|
||||||
|
(ert-deftest ob-exp/noweb-no-export-and-exports-both ()
|
||||||
|
(org-test-at-id "8a820f6c-7980-43db-8a24-0710d33729c9"
|
||||||
|
(org-narrow-to-subtree)
|
||||||
|
(let ((html (org-export-as-html nil nil nil 'string 'body-only)))
|
||||||
|
(should (string-match (regexp-quote "noweb-no-export-and-exports-both-1")
|
||||||
|
html)))))
|
||||||
|
|
||||||
(provide 'test-ob-exp)
|
(provide 'test-ob-exp)
|
||||||
|
|
||||||
;;; test-ob-exp.el ends here
|
;;; test-ob-exp.el ends here
|
||||||
|
|
Loading…
Reference in New Issue