File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -258,15 +258,15 @@ 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 began with a different one */
261
+ /* The following three rules make it that ' or " or ` are allowed inside links if the link didn't begin with them */
262
262
case CharCode . SingleQuote :
263
- chClass = ( linkBeginChCode === CharCode . DoubleQuote || linkBeginChCode === CharCode . BackTick ) ? CharacterClass . None : CharacterClass . ForceTermination ;
263
+ chClass = ( linkBeginChCode === CharCode . SingleQuote ? CharacterClass . ForceTermination : CharacterClass . None ) ;
264
264
break ;
265
265
case CharCode . DoubleQuote :
266
- chClass = ( linkBeginChCode === CharCode . SingleQuote || linkBeginChCode === CharCode . BackTick ) ? CharacterClass . None : CharacterClass . ForceTermination ;
266
+ chClass = ( linkBeginChCode === CharCode . DoubleQuote ? CharacterClass . ForceTermination : CharacterClass . None ) ;
267
267
break ;
268
268
case CharCode . BackTick :
269
- chClass = ( linkBeginChCode === CharCode . SingleQuote || linkBeginChCode === CharCode . DoubleQuote ) ? CharacterClass . None : CharacterClass . ForceTermination ;
269
+ chClass = ( linkBeginChCode === CharCode . BackTick ? CharacterClass . ForceTermination : CharacterClass . None ) ;
270
270
break ;
271
271
case CharCode . Asterisk :
272
272
// `*` terminates a link if the link began with `*`
Original file line number Diff line number Diff line change @@ -258,4 +258,11 @@ suite('Editor Modes - Link Computer', () => {
258
258
'https://site.web/page.html '
259
259
) ;
260
260
} ) ;
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 ` ,
266
+ ) ;
267
+ } ) ;
261
268
} ) ;
You can’t perform that action at this time.
0 commit comments