routes: fix internal link detection
ci/woodpecker/push/woodpecker Pipeline was successful Details
ci/woodpecker/pr/woodpecker Pipeline was successful Details

it just checked link length, but should at least ensure that the
condition which checks for internal links starts with a slash.
pull/84/head
OFF0 9 months ago
parent 80d3a3f6a7
commit 25d3283a80
Signed by: offbyn
GPG Key ID: 94A2F643C51F37FA

@ -317,7 +317,7 @@ const handleLink = (a: HTMLAnchorElement, e: MouseEvent) => {
|| href.startsWith('/feed') || href.startsWith('/feed')
|| href.startsWith('/note') || href.startsWith('/note')
|| href.startsWith('/npub') || href.startsWith('/npub')
|| href.length === 65 || (href.startsWith('/') && href.length === 65)
) { ) {
route(href); route(href);
history.pushState({}, '', href); history.pushState({}, '', href);

Loading…
Cancel
Save