M. ‘quintus’ Gülker <post+orgmod...@guelker.eu> writes: >> It sounds reasonable to allow macros inside citation references. >> Maybe we also want to allow other things. Maybe simply allow all objects >> but other citations, line-breaks, and table-cells? > > I have no strong opinion on this. I certainly do not need tables inside > citations. If it is easy to just permit everything except what you > named, I would say just allow it. Maybe someone has use for it. Maybe > footnotes inside [cite:] construct should also not be allowed, at least > for footnote-based styles.
See the attached WIP patch. Note that I also removed link as our tests explicitly test against having links inside citation references. However, I can see how links can be useful in prefix/suffix... I am wondering what was the rationale behind disallowing so many objects inside citation references.
>From aa3fac7248aa1201bbf92d492dcd5c79f8d0a544 Mon Sep 17 00:00:00 2001 Message-Id: <aa3fac7248aa1201bbf92d492dcd5c79f8d0a544.1666067320.git.yanta...@posteo.net> From: Ihor Radchenko <yanta...@posteo.net> Date: Tue, 18 Oct 2022 12:22:56 +0800 Subject: [PATCH] org-element: Allow more objects inside citations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * lisp/org-element.el (org-element-object-restrictions): Allow all but citation, citation-reference, line-break, table-cell, link and footnote-reference objects inside citations. Reported-by: M. ‘quintus’ Gülker <post+orgmod...@guelker.eu> Link: https://orgmode.org/list/87tu425pla....@guelker.eu --- lisp/org-element.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lisp/org-element.el b/lisp/org-element.el index 7b26e877e..7aac00087 100644 --- a/lisp/org-element.el +++ b/lisp/org-element.el @@ -401,10 +401,14 @@ (defconst org-element-object-restrictions subscript superscript underline verbatim)) (standard-set (remq 'citation-reference (remq 'table-cell org-element-all-objects))) - (standard-set-no-line-break (remq 'line-break standard-set))) + (standard-set-no-line-break (remq 'line-break standard-set)) + (standard-set-for-citations (seq-difference + standard-set-no-line-break + '( citation citation-reference + footnote-reference link)))) `((bold ,@standard-set) (citation citation-reference) - (citation-reference ,@minimal-set) + (citation-reference ,@standard-set-for-citations) (footnote-reference ,@standard-set) (headline ,@standard-set-no-line-break) (inlinetask ,@standard-set-no-line-break) -- 2.35.1
-- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at <https://orgmode.org/>. Support Org development at <https://liberapay.com/org-mode>, or support my work at <https://liberapay.com/yantar92>