Fix internal link detection

Links may also use mailto: or other schemes
pull/6449/head
Chocobozzz 2024-06-20 10:48:01 +02:00
parent 4d5ce84db9
commit 045e6af1d5
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 1 additions and 1 deletions

View File

@ -43,7 +43,7 @@ export class PluginPagesComponent implements OnDestroy, AfterViewInit {
// Get the href attribute set by the dev, not the one calculated by JS to detect if it's a relative/external link // Get the href attribute set by the dev, not the one calculated by JS to detect if it's a relative/external link
const href = a.getAttribute('href') const href = a.getAttribute('href')
if (a.target !== '_blank' && !href.match(/^https?:\/\//)) { if (a.target !== '_blank' && !href.startsWith('/')) {
event.preventDefault() event.preventDefault()
event.stopPropagation() event.stopPropagation()