File tree Expand file tree Collapse file tree 2 files changed +22
-10
lines changed Expand file tree Collapse file tree 2 files changed +22
-10
lines changed Original file line number Diff line number Diff line change @@ -258,15 +258,19 @@ export class LinkComputer {
258
258
case CharCode . CloseCurlyBrace :
259
259
chClass = ( hasOpenCurlyBracket ? CharacterClass . None : CharacterClass . ForceTermination ) ;
260
260
break ;
261
- /* The following three rules make it that ' or " or ` are allowed inside links if the link didn't begin with them */
261
+
262
+ // The following three rules make it that ' or " or ` are allowed inside links
263
+ // only if the link is wrapped by some other quote character
262
264
case CharCode . SingleQuote :
263
- chClass = ( linkBeginChCode === CharCode . SingleQuote ? CharacterClass . ForceTermination : CharacterClass . None ) ;
264
- break ;
265
265
case CharCode . DoubleQuote :
266
- chClass = ( linkBeginChCode === CharCode . DoubleQuote ? CharacterClass . ForceTermination : CharacterClass . None ) ;
267
- break ;
268
266
case CharCode . BackTick :
269
- chClass = ( linkBeginChCode === CharCode . BackTick ? CharacterClass . ForceTermination : CharacterClass . None ) ;
267
+ if ( linkBeginChCode === chCode ) {
268
+ chClass = CharacterClass . ForceTermination ;
269
+ } else if ( linkBeginChCode === CharCode . SingleQuote || linkBeginChCode === CharCode . DoubleQuote || linkBeginChCode === CharCode . BackTick ) {
270
+ chClass = CharacterClass . None ;
271
+ } else {
272
+ chClass = CharacterClass . ForceTermination ;
273
+ }
270
274
break ;
271
275
case CharCode . Asterisk :
272
276
// `*` terminates a link if the link began with `*`
Original file line number Diff line number Diff line change @@ -259,10 +259,18 @@ suite('Editor Modes - Link Computer', () => {
259
259
) ;
260
260
} ) ;
261
261
262
- test ( 'issue #151631: Link parsing stoped where comments include a single quote ' , ( ) => {
263
- assertLink (
264
- `aa https://regexper.com/#%2F''%2F aa` ,
265
- ` https://regexper.com/#%2F''%2F ` ,
262
+ // Removed because of #156875
263
+ // test('issue #151631: Link parsing stoped where comments include a single quote ', () => {
264
+ // assertLink(
265
+ // `aa https://regexper.com/#%2F''%2F aa`,
266
+ // ` https://regexper.com/#%2F''%2F `,
267
+ // );
268
+ // });
269
+
270
+ test ( 'issue #156875: Links include quotes ' , ( ) => {
271
+ assertLink (
272
+ `"This file has been converted from https://github.com/jeff-hykin/better-c-syntax/blob/master/autogenerated/c.tmLanguage.json",` ,
273
+ ` https://github.com/jeff-hykin/better-c-syntax/blob/master/autogenerated/c.tmLanguage.json ` ,
266
274
) ;
267
275
} ) ;
268
276
} ) ;
You can’t perform that action at this time.
0 commit comments