mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2025-01-05 11:45:52 +00:00
ox: Fix radio link resolution
* lisp/ox.el (org-export-resolve-radio-link): Radio targets are case-insensitive. * testing/lisp/test-ox.el: Add test.
This commit is contained in:
parent
6dd035c925
commit
2df6ded853
@ -3746,7 +3746,9 @@ has type \"radio\"."
|
||||
(let ((path (org-element-property :path link)))
|
||||
(org-element-map (plist-get info :parse-tree) 'radio-target
|
||||
(lambda (radio)
|
||||
(when (equal (org-element-property :value radio) path) radio))
|
||||
(and (compare-strings
|
||||
(org-element-property :value radio) 0 nil path 0 nil t)
|
||||
radio))
|
||||
info 'first-match)))
|
||||
|
||||
|
||||
|
@ -1432,18 +1432,27 @@ Another text. (ref:text)
|
||||
(ert-deftest test-org-export/resolve-radio-link ()
|
||||
"Test `org-export-resolve-radio-link' specifications."
|
||||
;; Standard test.
|
||||
(org-test-with-temp-text "<<<radio>>> radio"
|
||||
(org-update-radio-target-regexp)
|
||||
(should
|
||||
(should
|
||||
(org-test-with-temp-text "<<<radio>>> radio"
|
||||
(org-update-radio-target-regexp)
|
||||
(let* ((tree (org-element-parse-buffer))
|
||||
(info `(:parse-tree ,tree)))
|
||||
(org-export-resolve-radio-link
|
||||
(org-element-map tree 'link 'identity info t)
|
||||
info))))
|
||||
;; Radio targets are case-insensitive.
|
||||
(should
|
||||
(org-test-with-temp-text "<<<RADIO>>> radio"
|
||||
(org-update-radio-target-regexp)
|
||||
(let* ((tree (org-element-parse-buffer))
|
||||
(info `(:parse-tree ,tree)))
|
||||
(org-export-resolve-radio-link
|
||||
(org-element-map tree 'link 'identity info t)
|
||||
info))))
|
||||
;; Radio target with objects.
|
||||
(org-test-with-temp-text "<<<radio \\alpha>>> radio \\alpha"
|
||||
(org-update-radio-target-regexp)
|
||||
(should
|
||||
(should
|
||||
(org-test-with-temp-text "<<<radio \\alpha>>> radio \\alpha"
|
||||
(org-update-radio-target-regexp)
|
||||
(let* ((tree (org-element-parse-buffer))
|
||||
(info `(:parse-tree ,tree)))
|
||||
(org-export-resolve-radio-link
|
||||
|
Loading…
Reference in New Issue
Block a user