Skip to content

Commit

Permalink
tweak: ignore protocol links (e.g. "tel:", "mailto:")
Browse files Browse the repository at this point in the history
  • Loading branch information
roydejong committed Apr 3, 2024
1 parent 8aa93a6 commit b6ee22a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stim.js",
"version": "0.13.3",
"version": "0.13.4",
"description": "Lightweight drop-in frontend framework for SSR apps",
"main": "build/stim.js",
"license": "MIT",
Expand Down
4 changes: 2 additions & 2 deletions src/core/Navi.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ export default class Navi {

static getIsLinkElementCompatible(link) {
const href = link.getAttribute('href');
if (!href || href.startsWith('#') || href.indexOf('://') >= 0) {
// Reject - link does not have a valid href, links to an #anchor, or is an external link.
if (!href || href.startsWith('#') || href.indexOf(':') >= 0) {
// Reject - link does not have a valid href, links to an #anchor, or is an external/protocol link.
return false;
}
if (link.target && link.target !== "_self") {
Expand Down

0 comments on commit b6ee22a

Please sign in to comment.