Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions website/src/components/anchor-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Loading