Skip to content

Commit

Permalink
link.js: More robust parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
earthboundkid committed Jun 3, 2024
1 parent 3156cd4 commit 7eefa7a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/link.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export function toAbs(relurl) {
if (!relurl) {
return "";
if (!relurl || !URL.canParse(relurl, "https://www.spotlightpa.org")) {
return relurl;
}
return new URL(relurl, "https://www.spotlightpa.org").href;
}
Expand Down

0 comments on commit 7eefa7a

Please sign in to comment.