We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 460f39b commit e5a643aCopy full SHA for e5a643a
packages/@vuepress/shared/__tests__/utils/isLinkExternal.spec.ts
@@ -4,16 +4,22 @@ const testCases: [
4
Parameters<typeof isLinkExternal>,
5
ReturnType<typeof isLinkExternal>
6
][] = [
7
+ // with default base `/`
8
[['https://foobar.com'], true],
9
[['http://foobar.com'], true],
10
[['//foobar.com'], true],
11
[['foobar.com'], false],
12
[['/foo/bar'], false],
13
+ [['foo/bar'], false],
14
+ [['../foo/bar'], false],
15
+
16
+ // with base `/base/`
17
[['/foo/bar', '/base/'], true],
18
+ [['foo/bar', '/base/'], false],
19
+ [['../foo/bar', '/base/'], false],
20
[['/base/foo/bar', '/base/'], false],
21
[['mailto:foobar', '/base/'], false],
22
[['tel:foobar', '/base/'], false],
- [['../foo/bar', '/base/'], false],
23
]
24
25
describe('shared > isLinkExternal', () => {
0 commit comments