🐛 (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 store = useUserRepoStore()
|
||||||
|
|
||||||
const linkNote: EventListener = (event) => {
|
const linkNote: EventListener = (event) => {
|
||||||
event.preventDefault()
|
|
||||||
event.stopPropagation()
|
|
||||||
const target = event.target as HTMLElement
|
const target = event.target as HTMLElement
|
||||||
const href = target.getAttribute('href')
|
const href = target.getAttribute('href')
|
||||||
|
|
||||||
@@ -16,6 +14,13 @@ export const useLinks = (className: string, sha?: string) => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (href.startsWith('#')) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
event.preventDefault()
|
||||||
|
event.stopPropagation()
|
||||||
|
|
||||||
if (isExternalLink(href)) {
|
if (isExternalLink(href)) {
|
||||||
window.open(href, '_blank')
|
window.open(href, '_blank')
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user