mirror of
https://github.com/microsoft/vscode.git
synced 2026-09-28 08:04:00 +01:00
@@ -205,7 +205,7 @@ export function toLinkSuffix(match: RegExpExecArray | null): ILinkSuffix | null
|
||||
}
|
||||
|
||||
// Paths cannot start with opening brackets
|
||||
const linkWithSuffixPathCharacters = /(?<path>[^\s\[\({][^\s]*)$/;
|
||||
const linkWithSuffixPathCharacters = /(?<path>[^\s\|\[\({][^\s\|]*)$/;
|
||||
|
||||
export function detectLinks(line: string, os: OperatingSystem) {
|
||||
// 1: Detect all links on line via suffixes first
|
||||
|
||||
+39
@@ -329,6 +329,45 @@ suite('TerminalLinkParsing', () => {
|
||||
);
|
||||
});
|
||||
|
||||
test('should exclude pipe characters from link paths', () => {
|
||||
deepStrictEqual(
|
||||
detectLinks('|C:\\Github\\microsoft\\vscode|', OperatingSystem.Windows),
|
||||
[
|
||||
{
|
||||
path: {
|
||||
index: 1,
|
||||
text: 'C:\\Github\\microsoft\\vscode'
|
||||
},
|
||||
prefix: undefined,
|
||||
suffix: undefined
|
||||
}
|
||||
] as IParsedLink[]
|
||||
);
|
||||
});
|
||||
|
||||
test('should exclude pipe characters from link paths with suffixes', () => {
|
||||
deepStrictEqual(
|
||||
detectLinks('|C:\\Github\\microsoft\\vscode:400|', OperatingSystem.Windows),
|
||||
[
|
||||
{
|
||||
path: {
|
||||
index: 1,
|
||||
text: 'C:\\Github\\microsoft\\vscode'
|
||||
},
|
||||
prefix: undefined,
|
||||
suffix: {
|
||||
col: undefined,
|
||||
row: 400,
|
||||
suffix: {
|
||||
index: 27,
|
||||
text: ':400'
|
||||
}
|
||||
}
|
||||
}
|
||||
] as IParsedLink[]
|
||||
);
|
||||
});
|
||||
|
||||
suite('should detect file names in git diffs', () => {
|
||||
test('--- a/foo/bar', () => {
|
||||
deepStrictEqual(
|
||||
|
||||
Reference in New Issue
Block a user