🐛 (link) anchor links have default use
This commit is contained in:
@@ -7,8 +7,6 @@ export const useLinks = (className: string, sha?: string) => {
|
||||
const store = useUserRepoStore()
|
||||
|
||||
const linkNote: EventListener = (event) => {
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
const target = event.target as HTMLElement
|
||||
const href = target.getAttribute('href')
|
||||
|
||||
@@ -16,6 +14,13 @@ export const useLinks = (className: string, sha?: string) => {
|
||||
return
|
||||
}
|
||||
|
||||
if (href.startsWith('#')) {
|
||||
return
|
||||
}
|
||||
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
|
||||
if (isExternalLink(href)) {
|
||||
window.open(href, '_blank')
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user