Improve Open-with URL encoding (#33666)

Fix #33665
This commit is contained in:
wxiaoguang
2025-02-22 01:46:05 +08:00
committed by GitHub
parent a61014ea47
commit ead716d204
2 changed files with 16 additions and 1 deletions

View File

@ -0,0 +1,7 @@
import {substituteRepoOpenWithUrl} from './repo-common.ts';
test('substituteRepoOpenWithUrl', () => {
// For example: "x-github-client://openRepo/https://github.com/go-gitea/gitea"
expect(substituteRepoOpenWithUrl('proto://a/{url}', 'https://gitea')).toEqual('proto://a/https://gitea');
expect(substituteRepoOpenWithUrl('proto://a?link={url}', 'https://gitea')).toEqual('proto://a?link=https%3A%2F%2Fgitea');
});