Skip to content

Commit

Permalink
fix: avoid double leading slashes in default href resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusforsberg committed Jun 4, 2024
1 parent b87f200 commit b9fa67a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/helpers/generateHref.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const generateHref = {
isInternalLink(link) && link.internalLink
? hrefResolver
? hrefResolver(link)
: `/${link.internalLink.slug?.current}`
: `/${link.internalLink.slug?.current?.replace(/^\//, '')}`
: '#',
external: (link: LinkValue) =>
isExternalLink(link) && link.url
Expand Down

0 comments on commit b9fa67a

Please sign in to comment.