Fixing the logic for `isExternalLink` (#2687)
`.href` is computed from the real value of the attribute, and this was causing an issue where isExternalLink would classify links that should not be external links as external links.
This commit is contained in:
parent
ec00ee3c04
commit
15d2cbbc8c
|
@ -320,7 +320,7 @@ export default Vue.extend({
|
|||
},
|
||||
|
||||
openAllLinksExternally: function () {
|
||||
const isExternalLink = (event) => event.target.tagName === 'A' && event.target.href.startsWith('http')
|
||||
const isExternalLink = (event) => event.target.tagName === 'A' && !event.target.href.startsWith(window.location.origin)
|
||||
|
||||
document.addEventListener('click', (event) => {
|
||||
if (isExternalLink(event)) {
|
||||
|
|
Loading…
Reference in New Issue