forked from mirrors/org-mode
ox: Fix smart quotes within tables
* lisp/ox.el (org-export--smart-quote-status): Handle smart quotes within objects. * testing/lisp/test-ox.el (test-org-export/activate-smart-quotes): Add tests. Reported-by: Philipp Middendorf <pmi@hacon.de> <http://permalink.gmane.org/gmane.emacs.orgmode/105586>
This commit is contained in:
parent
cb5f323b0d
commit
5a735b0b80
|
@ -5200,7 +5200,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))
|
||||
|
|
|
@ -2998,6 +2998,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))))))
|
||||
|
|
Loading…
Reference in New Issue