Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: enhancement of isExternal #2093

Merged
merged 2 commits into from
Jun 18, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
test: add test for isExternal
sy-records committed Jun 17, 2023
commit 942a162d2f91019c01065d5ffb03cfb94b7e020c
12 changes: 12 additions & 0 deletions test/unit/core-util.test.js
Original file line number Diff line number Diff line change
@@ -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();
});
});
});