Skip to content

Commit

Permalink
feat: ignore the handling of http links
Browse files Browse the repository at this point in the history
  • Loading branch information
zouhangwithsweet committed Jul 2, 2021
1 parent d971dd9 commit 16a241d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/client/app/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { siteDataRef } from './data'
import { inBrowser } from '../shared'

const EXTERNAL_URL_RE = /^https?:/i

export { inBrowser }

/**
Expand All @@ -11,7 +13,9 @@ export function joinPath(base: string, path: string): string {
}

export function withBase(path: string) {
return joinPath(siteDataRef.value.base, path)
return EXTERNAL_URL_RE.test(path)
? path
: joinPath(siteDataRef.value.base, path)
}

/**
Expand Down

0 comments on commit 16a241d

Please sign in to comment.