From c0d51ff401e83ad7af77343f6c14a4e7c8ad545d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20Bl=C3=A4ttermann?= Date: Tue, 10 Feb 2026 14:07:20 +0100 Subject: [PATCH 01/16] feat: remove click hijacking from readme --- app/components/Readme.vue | 62 --------------------------------------- 1 file changed, 62 deletions(-) diff --git a/app/components/Readme.vue b/app/components/Readme.vue index 512e217cf..a9bf836c9 100644 --- a/app/components/Readme.vue +++ b/app/components/Readme.vue @@ -2,67 +2,6 @@ defineProps<{ html: string }>() - -const router = useRouter() -const { copy } = useClipboard() - -// Combined click handler for: -// 1. Intercepting npmjs.com links to route internally -// 2. Copy button functionality for code blocks -function handleClick(event: MouseEvent) { - const target = event.target as HTMLElement | undefined - if (!target) return - - // Handle copy button clicks - const copyTarget = target.closest('[data-copy]') - if (copyTarget) { - const wrapper = copyTarget.closest('.readme-code-block') - if (!wrapper) return - - const pre = wrapper.querySelector('pre') - if (!pre?.textContent) return - - copy(pre.textContent) - - const icon = copyTarget.querySelector('span') - if (!icon) return - - const originalIcon = 'i-carbon:copy' - const successIcon = 'i-carbon:checkmark' - - icon.classList.remove(originalIcon) - icon.classList.add(successIcon) - - setTimeout(() => { - icon.classList.remove(successIcon) - icon.classList.add(originalIcon) - }, 2000) - return - } - - // Handle npmjs.com link clicks - route internally - const anchor = target.closest('a') - if (!anchor) return - - const href = anchor.getAttribute('href') - if (!href) return - - // Handle relative anchor links - if (href.startsWith('#')) { - event.preventDefault() - router.push(href) - return - } - - const match = href.match(/^(?:https?:\/\/)?(?:www\.)?npmjs\.(?:com|org)(\/.+)$/) - if (!match || !match[1]) return - - const route = router.resolve(match[1]) - if (route) { - event.preventDefault() - router.push(route) - } -} From df6ecb00e65734a164506bcee8343adc35c16606 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20Bl=C3=A4ttermann?= Date: Tue, 10 Feb 2026 14:44:50 +0100 Subject: [PATCH 02/16] feat: add external link indicator to readme --- server/utils/readme.ts | 8 +++++++- test/unit/server/utils/readme.spec.ts | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/server/utils/readme.ts b/server/utils/readme.ts index 21dcf735c..c65c387e5 100644 --- a/server/utils/readme.ts +++ b/server/utils/readme.ts @@ -368,6 +368,12 @@ ${html} const isExternal = resolvedHref.startsWith('http://') || resolvedHref.startsWith('https://') const relAttr = isExternal ? ' rel="nofollow noreferrer noopener"' : '' const targetAttr = isExternal ? ' target="_blank"' : '' + const isExternalIcon = isExternal + ? `