compat(footnote): support alt footnote inside placeholder anchor (#2858)

This commit is contained in:
Huang Xin
2026-01-04 06:06:24 +01:00
committed by GitHub
parent ca8d25341e
commit 69a51c5880
@@ -177,10 +177,13 @@ export const handleClick = (
const postSingleClick = () => {
const element = event.target as HTMLElement | null;
if (element?.closest('sup, a, audio, video')) {
if (
element?.closest('sup, a, audio, video') &&
!element?.closest('a.duokan-footnote:not([href])')
) {
return;
}
const footnote = element?.closest('.js_readerFooterNote, .zhangyue-footnote');
const footnote = element?.closest('.js_readerFooterNote, .zhangyue-footnote, .duokan-footnote');
if (footnote) {
eventDispatcher.dispatch('footnote-popup', {
bookKey,
@@ -189,6 +192,7 @@ export const handleClick = (
footnote.getAttribute('data-wr-footernote') ||
footnote.getAttribute('zy-footnote') ||
footnote.getAttribute('alt') ||
element?.getAttribute('alt') ||
'',
});
return;