mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2025-01-20 19:24:20 +00:00
ox: Fix radio target resolution
* lisp/ox.el (org-export-resolve-radio-link): Fix radio target resolution. * testing/lisp/test-ox.el: Add test.
This commit is contained in:
parent
7d37898371
commit
e7cd6f1875
@ -4082,8 +4082,9 @@ has type \"radio\"."
|
||||
(let ((path (org-element-property :path link)))
|
||||
(org-element-map (plist-get info :parse-tree) 'radio-target
|
||||
(lambda (radio)
|
||||
(and (compare-strings
|
||||
(org-element-property :value radio) 0 nil path 0 nil t)
|
||||
(and (eq (compare-strings
|
||||
(org-element-property :value radio) 0 nil path 0 nil t)
|
||||
t)
|
||||
radio))
|
||||
info 'first-match)))
|
||||
|
||||
|
@ -1707,7 +1707,19 @@ Another text. (ref:text)
|
||||
(info `(:parse-tree ,tree)))
|
||||
(org-export-resolve-radio-link
|
||||
(org-element-map tree 'link 'identity info t)
|
||||
info)))))
|
||||
info))))
|
||||
;; Multiple radio targets.
|
||||
(should
|
||||
(equal '("radio1" "radio2")
|
||||
(org-test-with-temp-text "<<<radio1>>> <<<radio2>>> radio1 radio2"
|
||||
(org-update-radio-target-regexp)
|
||||
(let* ((tree (org-element-parse-buffer))
|
||||
(info `(:parse-tree ,tree)))
|
||||
(org-element-map tree 'link
|
||||
(lambda (link)
|
||||
(org-element-property
|
||||
:value (org-export-resolve-radio-link link info)))
|
||||
info))))))
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user