diff --git a/lisp/org-html.el b/lisp/org-html.el
index fde563b..806bbb9 100644
--- a/lisp/org-html.el
+++ b/lisp/org-html.el
@@ -1438,8 +1438,9 @@ lang=\"%s\" xml:lang=\"%s\">
(replace-regexp-in-string
"\\." "-" (format "sec-%s" snumber)))
(setq href (org-solidify-link-text
- (or (cdr (assoc href
- org-export-preferred-target-alist)) href)))
+ (or (cdr (assoc href org-export-preferred-target-alist))
+ (cdr (assoc href org-export-id-target-alist))
+ href)))
(push
(format
(if todo
@@ -2413,7 +2414,8 @@ When TITLE is nil, just close all open levels."
(assoc target org-export-target-aliases)))
(extra-class (and title (org-get-text-property-any 0 'html-container-class title)))
(preferred (and target
- (cdr (assoc target org-export-preferred-target-alist))))
+ (or (cdr (assoc target org-export-preferred-target-alist))
+ (cdr (assoc target org-export-id-target-alist)))))
(l org-level-max)
(num (plist-get opt-plist :section-numbers))
snumber snu href suffix)