We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
name
1 parent bfc7c8a commit 25b0c99Copy full SHA for 25b0c99
web_src/js/markup/anchors.js
@@ -39,7 +39,7 @@ export function initMarkupAnchors() {
39
if (!href.startsWith('#user-content-')) continue;
40
const originalId = href.replace(/^#user-content-/, '');
41
a.setAttribute('href', `#${encodeURIComponent(originalId)}`);
42
- if (document.getElementsByName(originalId).length !== 1) {
+ if (a.closest('.markup').querySelectorAll(`a[name="${originalId}"]`).length !== 1) {
43
a.addEventListener('click', (e) => {
44
scrollToAnchor(e.currentTarget.getAttribute('href'), false);
45
});
0 commit comments