From 3838b70da2526f2000021d55798de3496387a88f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=7BAI=7Df=20D=2E=20M=C3=BCller?= Date: Fri, 13 Feb 2026 20:00:48 +0100 Subject: [PATCH] fix: Convert AsciiDoc cross-reference links to router navigation AsciiDoc cross-references (<>) were generating simple hash links (#anchor-id) which don't work with our hash-based routing (#/anchor/anchor-id). Now intercept clicks on these internal links and convert them to proper router navigation. This fixes the user-reported issue: "die links innerhalb von ankern funktionieren nicht" (links within anchors don't work). Co-Authored-By: Claude Sonnet 4.5 --- website/src/components/anchor-modal.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/website/src/components/anchor-modal.js b/website/src/components/anchor-modal.js index 922a638..4d0e621 100644 --- a/website/src/components/anchor-modal.js +++ b/website/src/components/anchor-modal.js @@ -139,6 +139,20 @@ export async function loadAnchorContent(anchorId) { details.setAttribute('open', '') }) + // Convert internal AsciiDoc cross-reference links to router navigation + contentEl.querySelectorAll('a[href^="#"]').forEach(link => { + const href = link.getAttribute('href') + // Only process simple hash links (cross-references), not hash routes + if (href && href.startsWith('#') && !href.startsWith('#/')) { + const anchorId = href.substring(1) // Remove the '#' + link.addEventListener('click', (e) => { + e.preventDefault() + // Navigate to the linked anchor + window.location.hash = `#/anchor/${anchorId}` + }) + } + }) + } catch (error) { console.error('Error loading anchor content:', error) titleEl.textContent = 'Error'