We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents b4412c8 + 35b9f0b commit 84feb91Copy full SHA for 84feb91
src/theme/scripts/router.js
@@ -34,8 +34,11 @@ class Router {
34
}
35
36
async _onLinkClick(event) {
37
- if(event.target.tagName !== 'A') return;
38
- const link = new URL(event.target.href);
+ // 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');
39
+ 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) {
44
return;
0 commit comments