Skip to content

Commit b5652be

Browse files
committed
Have * terminate a link only when the character before the link is also a *
1 parent ed74af8 commit b5652be

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

src/vs/editor/common/modes/linkComputer.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,8 @@ export class LinkComputer {
265265
chClass = (linkBeginChCode === CharCode.SingleQuote || linkBeginChCode === CharCode.DoubleQuote) ? CharacterClass.None : CharacterClass.ForceTermination;
266266
break;
267267
case CharCode.Asterisk:
268-
chClass = CharacterClass.ForceTermination;
268+
// `*` terminates a link if the link began with `*`
269+
chClass = (linkBeginChCode === CharCode.Asterisk) ? CharacterClass.ForceTermination : CharacterClass.None;
269270
break;
270271
default:
271272
chClass = classifier.get(chCode);

src/vs/editor/test/common/modes/linkComputer.test.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ suite('Editor Modes - Link Computer', () => {
185185
);
186186
assertLink(
187187
'let url = `http://***/_api/web/lists/GetByTitle(\'Teambuildingaanvragen\')/items`;',
188-
' http://* '
188+
' http://***/_api/web/lists/GetByTitle(\'Teambuildingaanvragen\')/items '
189189
);
190190
});
191191

@@ -202,4 +202,11 @@ suite('Editor Modes - Link Computer', () => {
202202
' http://[::1]:5000/connect/token '
203203
);
204204
});
205+
206+
test('issue #70254: bold links dont open in markdown file using editor mode with ctrl + click', () => {
207+
assertLink(
208+
'2. Navigate to **https://portal.azure.com**',
209+
' https://portal.azure.com '
210+
);
211+
});
205212
});

0 commit comments

Comments
 (0)