Open omidmnz opened 6 years ago
This "unexpected behavior" involves the way anki-editor works, that when it is building the content of a field, it does the exporting on the region of subtree of that field entry, this way Org has no idea where that noweb block is defined, but when you evaluate the source block, Org will search backward the buffer for the definition of the noweb block.
Thanks for clarification. Should I consider this as a "Won't Fix" tag?
This also prevents globally set headers (#+PROPERTY: header-args ...
, see https://orgmode.org/manual/Property-Syntax.html ) from working properly.
Interestingly, interactively calling anki-editor-export-subtree-to-html
(which is defined but never used in anki-editor.el
) with the point inside the respective body returns the correct result for me (i.e. respects the global header args) - is there a reason to prefer using org-export-string-as
in anki-editor--build-fields
over using this (or the method used there)?
I use Noweb reference syntax to embed some code in all my source blocks, which needs
:noweb yes
in the source blocks' headers. The code works perfectly fine when I execute the block myself, butanki-editor-push-notes
executes the blocks without the header, which leads to wrong outputs. I tried:cache yes
to avoid the problem, butanki-editor-push-notes
seems to ignore that too. Here is a minimal example:The result of manual execution is
Noweb enabled.
as expected, but the pushed card readsNoweb not enabled.
. I am using Emacs 26.1, with Org Mode 9.1.14, and the latest anki-editor on Melpa.