mirror of
https://git.proxmox.com/git/mirror_xterm.js
synced 2025-10-18 13:31:32 +00:00
Merge pull request #606 from Tyriar/vscode22640_tilde_path
Allow ~ char in linkify path and query fragments
This commit is contained in:
commit
6d25706300
@ -49,6 +49,20 @@ describe('Linkifier', () => {
|
|||||||
element.dispatchEvent(event);
|
element.dispatchEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function assertLinkifiesEntireRow(uri: string, done: MochaDone) {
|
||||||
|
addRow(uri);
|
||||||
|
linkifier.linkifyRow(0);
|
||||||
|
setTimeout(() => {
|
||||||
|
assert.equal((<HTMLElement>rows[0].firstChild).tagName, 'A');
|
||||||
|
assert.equal((<HTMLElement>rows[0].firstChild).textContent, uri);
|
||||||
|
done();
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
describe('http links', () => {
|
||||||
|
it('should allow ~ character in URI path', done => assertLinkifiesEntireRow('http://foo.com/a~b#c~d?e~f', done));
|
||||||
|
});
|
||||||
|
|
||||||
describe('validationCallback', () => {
|
describe('validationCallback', () => {
|
||||||
it('should enable link if true', done => {
|
it('should enable link if true', done => {
|
||||||
addRow('test');
|
addRow('test');
|
||||||
|
@ -16,8 +16,8 @@ const ipClause = '((\\d{1,3}\\.){3}\\d{1,3})';
|
|||||||
const localHostClause = '(localhost)';
|
const localHostClause = '(localhost)';
|
||||||
const portClause = '(:\\d{1,5})';
|
const portClause = '(:\\d{1,5})';
|
||||||
const hostClause = '((' + domainBodyClause + '\\.' + tldClause + ')|' + ipClause + '|' + localHostClause + ')' + portClause + '?';
|
const hostClause = '((' + domainBodyClause + '\\.' + tldClause + ')|' + ipClause + '|' + localHostClause + ')' + portClause + '?';
|
||||||
const pathClause = '(\\/[\\/\\w\\.\\-%]*)*';
|
const pathClause = '(\\/[\\/\\w\\.\\-%~]*)*';
|
||||||
const queryStringHashFragmentCharacterSet = '[0-9\\w\\[\\]\\(\\)\\/\\?\\!#@$%&\'*+,:;\\=\\.\\-]*';
|
const queryStringHashFragmentCharacterSet = '[0-9\\w\\[\\]\\(\\)\\/\\?\\!#@$%&\'*+,:;~\\=\\.\\-]*';
|
||||||
const queryStringClause = '(\\?' + queryStringHashFragmentCharacterSet + ')?';
|
const queryStringClause = '(\\?' + queryStringHashFragmentCharacterSet + ')?';
|
||||||
const hashFragmentClause = '(#' + queryStringHashFragmentCharacterSet + ')?';
|
const hashFragmentClause = '(#' + queryStringHashFragmentCharacterSet + ')?';
|
||||||
const negatedPathCharacterSet = '[^\\/\\w\\.\\-%]+';
|
const negatedPathCharacterSet = '[^\\/\\w\\.\\-%]+';
|
||||||
|
Loading…
Reference in New Issue
Block a user