diff --git a/lisp/ox.el b/lisp/ox.el index 34ea32b3b..32ca2ff10 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -5854,7 +5854,7 @@ INFO is the current export state, as a plist." (let ((table (make-hash-table :test #'eq))) (plist-put info :smart-quote-cache table) table))) - (value (gethash parent cache 'missing-data))) + (value (gethash (cons parent (org-element-secondary-p s)) cache 'missing-data))) (if (not (eq value 'missing-data)) (cdr (assq s value)) (let (level1-open full-status) (org-element-map @@ -5922,7 +5922,7 @@ INFO is the current export state, as a plist." (when current-status (push (cons text (nreverse current-status)) full-status)))) info nil org-element-recursive-objects) - (puthash parent full-status cache) + (puthash (cons parent (org-element-secondary-p s)) full-status cache) (cdr (assq s full-status)))))) (defun org-export-activate-smart-quotes (s encoding info &optional original) diff --git a/testing/lisp/test-ox.el b/testing/lisp/test-ox.el index e59c20cae..63babe8cd 100644 --- a/testing/lisp/test-ox.el +++ b/testing/lisp/test-ox.el @@ -4229,6 +4229,14 @@ This test does not cover listings and custom environments." (org-element-map tree 'plain-text (lambda (s) (org-export-activate-smart-quotes s :html info)) info))))) + ;; Smart quotes when object has multiple secondary strings. + (should + (equal '(" “prefix” " " “suffix”") + (let ((org-export-default-language "en")) + (org-test-with-parsed-data "[cite:; \"prefix\" @key \"suffix\";]" + (org-element-map tree 'plain-text + (lambda (s) (org-export-activate-smart-quotes s :html info)) + info))))) ;; Smart quotes in document keywords. (should (equal '("“" "”")