mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-20 00:28:52 +01:00
Fixing false positive ref link being detected
This commit is contained in:
@@ -157,7 +157,7 @@ const linkPattern = /(\[((!\[[^\]]*?\]\(\s*)([^\s\(\)]+?)\s*\)\]|(?:\\\]|[^\]])*
|
||||
/**
|
||||
* Matches `[text][ref]`
|
||||
*/
|
||||
const referenceLinkPattern = /(?:(\[((?:\\\]|[^\]])+)\]\[\s*?)([^\s\]]*?)\]|\[\s*?([^\s\]]*?)\])(?!\:)/g;
|
||||
const referenceLinkPattern = /(?:(\[((?:\\\]|[^\]])+)\]\[\s*?)([^\s\]]*?)\]|\[\s*?([^\s\]]*?)\])(?![\:\(])/g;
|
||||
|
||||
/**
|
||||
* Matches `[text]: link`
|
||||
|
||||
@@ -106,12 +106,11 @@ export class MdReferencesProvider extends Disposable implements vscode.Reference
|
||||
|
||||
const references: MdReference[] = [];
|
||||
|
||||
const line = document.lineAt(header.line);
|
||||
references.push({
|
||||
kind: 'header',
|
||||
isTriggerLocation: true,
|
||||
isDefinition: true,
|
||||
location: new vscode.Location(document.uri, new vscode.Range(header.line, 0, header.line, line.text.length)),
|
||||
location: header.headerLocation,
|
||||
headerTextLocation: header.headerTextLocation
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user