Open neuhalje opened 5 months ago
Thanks, this is a very useful bug report. I have a feeling this may be a MWE for a problem I've been seeing myself.
I'll try to get to it sooner rather than later :)
The exporters :filter-parse-tree
will be called with the hidden things already hidden.
(defun org-export--annotate-info (backend info &optional subtreep visible-only ext-plist)
;;...
(setq tree
(org-export-filter-apply-functions
(plist-get info :filter-parse-tree) tree info))
;; ...
org-glossary--prepare-buffer
gets called with the backend
as a parameter. Maybe we could in org-glossary--prepare-buffer
:filter-parse-tree
in the backend
:filter-parse-tree
callback "do the thing" via the API:filter-parse-tree
would be a good place to auto-apply terms (we can just use org-export-filter-parse-tree-functions
), however org-glossary--prepare-buffer
is rather based around operating on the org text content directly, before parsing, and changing that would be quite a bit of work.
I'm not sure when I'll have the time to do this, but as a quick fix I can check for :noexport:
and COMMENT
headings and ignore terms inside of them.
#+title: test
#+OPTIONS: tasks:nil
This is a demonstration of a bug where references to non-exported elements show up in the acronyms/glossary
Expected: DEMO is only linked here
* Not exported :noexport:
This instance of DEMO should not show up in the glossary
* COMMENT Also hidden
This instance of DEMO should not show up in the glossary
* TODO Not hidden
This instance of DEMO shows up, even though it shouldn't
* Glossary
- DEMO :: mind that the export will also reference the hidden instances
Now exports to
#+options: tasks:nil
#+title: test
#+author: TEC
This is a demonstration of a bug where references to non-exported elements show up in the acronyms/glossary
Expected: <<gr;1;1>>[[g;1][DEMO]] is only linked here
* Glossary
- <<g;1>>DEMO :: mind that the export will also reference the hidden instances\ensp{}[[gr;1;1][1]], [[gr;1;2][2]]
As of bf0b72685342454c23104f455f63e0aaa70121f7
Observation
The following snippet, when exported with org-glossary enabled, will produce dead references in the result. Example with
org-export-as-org
.Observed Export Result
After export
[[gr;37;2][2]]
and[[gr;37;3][3]]
are dangling references.Expected Export Result
After export only
[[gr;37;1][1]]
is referenced.Analysis
The export settings will exclude the
Not exported :noexport:
section and the task from export.Both the occurence of
DEMO
in the task and in the:noexport:
section occur in the glosssary.This also happens in PDF export.
Work around(?)
Not tried. But if first the document is exported with
orrg->org
and then run the glossary, the issue should be resolved.