mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
fix anchor target
This commit is contained in:
@@ -49,12 +49,12 @@ const sanitizeOpts = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleAnchorClick (e) {
|
function handleAnchorClick (e) {
|
||||||
if (e.target.attributes.href && e.target.attributes.href.nodeValue.match(/#.+/)) {
|
if (this.attributes.href && this.attributes.href.nodeValue.match(/^#.+/)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
let href = e.target.href
|
let href = this.href
|
||||||
if (href && href.match(/^http:\/\/|https:\/\/|mailto:\/\//)) {
|
if (href && href.match(/^http:\/\/|https:\/\/|mailto:\/\//)) {
|
||||||
shell.openExternal(href)
|
shell.openExternal(href)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user