diff options
Diffstat (limited to 'src/static/js/client/scripted-link.js')
-rw-r--r-- | src/static/js/client/scripted-link.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/static/js/client/scripted-link.js b/src/static/js/client/scripted-link.js index 5db86e13..ca1c2548 100644 --- a/src/static/js/client/scripted-link.js +++ b/src/static/js/client/scripted-link.js @@ -190,11 +190,16 @@ export function mutatePageContent() { } function mutateNavigationLinkContent() { - const prependTitle = (el, prepend) => - el?.setAttribute('title', + const prependTitle = (el, prepend) => { + if (!el) return; + if (!el.hasAttribute('href')) return; + + el?.setAttribute( + 'title', (el.hasAttribute('title') ? prepend + ' ' + el.getAttribute('title') : prepend)); + }; prependTitle(info.nextNavLink, '(Shift+N)'); prependTitle(info.previousNavLink, '(Shift+P)'); |