We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fd18755 commit 35b9f0bCopy full SHA for 35b9f0b
src/theme/scripts/router.js
@@ -34,9 +34,10 @@ class Router {
34
}
35
36
async _onLinkClick(event) {
37
- // See if what is clicked has an anchor as parent or is a link itself and create an URL of it
38
- const link = event.target.closest('a') ? new URL(event.target.closest('a').href) : null;
39
- if (!link) return;
+ // See if what is clicked has an anchor as parent or is a link itself. If so create URL otherwise return.
+ const linkElement = event.target.closest('a');
+ if (!linkElement) return;
40
+ const link = new URL(linkElement.href);
41
42
// If it’s an external link, just navigate.
43
if(link.host !== this._hostname) {
0 commit comments