mirror of
https://github.com/docsifyjs/docsify.git
synced 2025-12-08 19:55:52 +00:00
fix: enhancement of isExternal (#2093)
This commit is contained in:
parent
46333edc69
commit
7f13ba0f98
@ -96,5 +96,8 @@ export function isExternal(url) {
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
if (/^\/\\/.test(url)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -59,5 +59,17 @@ describe('core/util', () => {
|
||||
|
||||
expect(result).toBeTruthy();
|
||||
});
|
||||
|
||||
test('external url with one \\', () => {
|
||||
const result = isExternal('/\\example.github.io/docsify/demo.md');
|
||||
|
||||
expect(result).toBeTruthy();
|
||||
});
|
||||
|
||||
test('external url with two \\', () => {
|
||||
const result = isExternal('/\\\\example.github.io/docsify/demo.md');
|
||||
|
||||
expect(result).toBeTruthy();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user