未验证 提交 092132a0 编写于 作者: A Alexandru Dima 提交者: GitHub

Merge pull request #62293 from gpoussel/fix-62278

Fix #62278: IPv6 links support
......@@ -249,7 +249,15 @@ class LinkComputer {
resetStateMachine = true;
}
} else if (state === State.End) {
const chClass = classifier.get(chCode);
let chClass: CharacterClass;
if (chCode === CharCode.OpenSquareBracket) {
// Allow for the authority part to contain ipv6 addresses which contain [ and ]
hasOpenSquareBracket = true;
chClass = CharacterClass.None;
} else {
chClass = classifier.get(chCode);
}
// Check if character terminates link
if (chClass === CharacterClass.ForceTermination) {
......
......@@ -195,4 +195,11 @@ suite('Editor Modes - Link Computer', () => {
' https://msdn.microsoft.com/en-us/library/windows/desktop/ms687414(v=vs.85).aspx '
);
});
test('issue #62278: "Ctrl + click to follow link" for IPv6 URLs', () => {
assertLink(
'let x = "http://[::1]:5000/connect/token"',
' http://[::1]:5000/connect/token '
);
});
});
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册