fix(externalLinks): make external link warning work with subpaths
This commit is contained in:
@@ -624,7 +624,8 @@ export function rewriteExternalLinks (view) {
|
||||
return
|
||||
}
|
||||
const noteURL = window.location.pathname.split('/').pop()
|
||||
anchor.attr('href', `${window.location.origin}/_link?url=${encodeURIComponent(parsed.href)}¬e=${noteURL}`)
|
||||
const urlPath = window.urlpath ? `/${window.urlpath}` : ''
|
||||
anchor.attr('href', `${window.location.origin}${urlPath}/_link?url=${encodeURIComponent(parsed.href)}¬e=${noteURL}`)
|
||||
})
|
||||
}
|
||||
window.rewriteExternalLinks = rewriteExternalLinks
|
||||
|
||||
Reference in New Issue
Block a user