提交 71bd31b5 编写于 作者: J Johannes Rieken

add support for file-links, fixes #6533

上级 78d8b4b1
......@@ -13,10 +13,10 @@ export interface ILinkComputerTarget {
// State machine for http:// or https://
var STATE_MAP:{[ch:string]:number}[] = [], START_STATE = 1, END_STATE = 9, ACCEPT_STATE = 10;
STATE_MAP[1] = { 'h': 2, 'H': 2 };
STATE_MAP[2] = { 't': 3, 'T': 3 };
STATE_MAP[3] = { 't': 4, 'T': 4 };
STATE_MAP[4] = { 'p': 5, 'P': 5 };
STATE_MAP[1] = { 'h': 2, 'H': 2, 'f': 2, 'F': 2 };
STATE_MAP[2] = { 't': 3, 'T': 3, 'i': 3, 'I': 3 };
STATE_MAP[3] = { 't': 4, 'T': 4, 'l': 4, 'L': 4 };
STATE_MAP[4] = { 'p': 5, 'P': 5, 'e': 6, 'E': 6 };
STATE_MAP[5] = { 's': 6, 'S': 6, ':': 7 };
STATE_MAP[6] = { ':': 7 };
STATE_MAP[7] = { '/': 8 };
......
......@@ -163,6 +163,25 @@ suite('Editor Modes - Link Computer', () => {
' http://go.microsoft.com/fwlink/?LinkId=761051 '
);
assertLink(
'x = "file:///foo.bar";',
' file:///foo.bar '
);
assertLink(
'x = "file://c:/foo.bar";',
' file://c:/foo.bar '
);
assertLink(
'x = "file://shares/foo.bar";',
' file://shares/foo.bar '
);
assertLink(
'x = "file://shäres/foo.bar";',
' file://shäres/foo.bar '
);
// foo bar (see http://www.w3schools.com/tags/att_iframe_sandbox.asp)
});
});
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册