Browse Source

Merge branch 'maint'

Nicolas Goaziou 4 years ago
parent
commit
0b59a5994e
2 changed files with 20 additions and 1 deletions
  1. 5 1
      lisp/ox.el
  2. 15 0
      testing/lisp/test-ox.el

+ 5 - 1
lisp/ox.el

@@ -5229,7 +5229,11 @@ INFO is the current export state, as a plist."
 	 (value (gethash parent cache 'missing-data)))
     (if (not (eq value 'missing-data)) (cdr (assq s value))
       (let (level1-open full-status)
-	(org-element-map parent 'plain-text
+	(org-element-map
+	    (let ((secondary (org-element-secondary-p s)))
+	      (if secondary (org-element-property secondary parent)
+		(org-element-contents parent)))
+	    'plain-text
 	  (lambda (text)
 	    (let ((start 0) current-status)
 	      (while (setq start (string-match "['\"]" text start))

+ 15 - 0
testing/lisp/test-ox.el

@@ -3067,6 +3067,21 @@ Another text. (ref:text)
    (equal '("“" "”" "Paragraph")
 	  (let ((org-export-default-language "en"))
 	    (org-test-with-parsed-data "#+CAPTION: \"$x$\"\nParagraph"
+	      (org-element-map tree 'plain-text
+		(lambda (s) (org-export-activate-smart-quotes s :html info))
+		info nil nil t)))))
+  ;; Smart quotes within objects.
+  (should
+   (equal '("“foo”")
+	  (let ((org-export-default-language "en"))
+	    (org-test-with-parsed-data "*\"foo\"*"
+	      (org-element-map tree 'plain-text
+		(lambda (s) (org-export-activate-smart-quotes s :html info))
+		info nil nil t)))))
+  (should
+   (equal '("“foo”")
+	  (let ((org-export-default-language "en"))
+	    (org-test-with-parsed-data "| \"foo\" |"
 	      (org-element-map tree 'plain-text
 		(lambda (s) (org-export-activate-smart-quotes s :html info))
 		info nil nil t))))))