Commit 7d6e8ee
Guard isHrefExternal against non-web protocols
isHrefExternal treated mailto:, tel:, and javascript: URLs as external
because new URL() yields origin "null" for non-web protocols, which
never matches window.location.origin. This meant the a11y decoration
plugin would incorrectly add the "opens in new tab" hint to non-web
links.
Add an explicit protocol check so only http/https URLs are considered
external. This mirrors the existing guard in isExternalLinkCandidate
but applies at the lower level so all callers are safe.
Co-authored-by: Claude <noreply@anthropic.com>1 parent 211ed27 commit 7d6e8ee
1 file changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
48 | 52 | | |
49 | 53 | | |
50 | 54 | | |
51 | 55 | | |
| 56 | + | |
52 | 57 | | |
53 | 58 | | |
54 | 59 | | |
| |||
0 commit comments