Skip to content

Commit

Permalink
Fix wiki toc link borken for non-English languages
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny committed Mar 20, 2024
1 parent 02bbdd4 commit 9f259df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web_src/js/markup/anchors.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function initMarkupAnchors() {
const href = a.getAttribute('href');
if (!href.startsWith('#user-content-')) continue;
const originalId = href.replace(/^#user-content-/, '');
a.setAttribute('href', `#${encodeURIComponent(originalId)}`);
a.setAttribute('href', `#${originalId}`);
if (a.closest('.markup').querySelectorAll(`a[name="${originalId}"]`).length !== 1) {
a.addEventListener('click', (e) => {
scrollToAnchor(e.currentTarget.getAttribute('href'), false);
Expand Down

0 comments on commit 9f259df

Please sign in to comment.