branch: externals-release/org
commit 7048876f6fa519513763c83bc5baa791420cddab
Author: Ihor Radchenko <yanta...@posteo.net>
Commit: Ihor Radchenko <yanta...@posteo.net>

    org-export-get-ordinal: Do not ignore ELEMENT type when TYPES is given
    
    * lisp/ox.el (org-export-get-ordinal): Append ELEMENT type to TYPES,
    when TYPES is non-nil.
---
 lisp/ox.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/ox.el b/lisp/ox.el
index 02c0ddefe4..c14eafe44d 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -4753,7 +4753,8 @@ objects of the same type."
      (let ((counter 0))
        ;; Increment counter until ELEMENT is found again.
        (org-element-map (plist-get info :parse-tree)
-          (or types (org-element-type element))
+          (or (and types (cons (org-element-type element) types))
+               (org-element-type element))
         (lambda (el)
            (let ((cached (org-element-property :org-export--counter el)))
             (cond

Reply via email to