Skip to content

Commit

Permalink
image link should be pushed to results before other link
Browse files Browse the repository at this point in the history
  • Loading branch information
flurmbo committed Jan 26, 2019
1 parent 5fdc5c2 commit 9070abe
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ export default class LinkProvider implements vscode.DocumentLinkProvider {
): vscode.DocumentLink[] {
const results: vscode.DocumentLink[] = [];
for (const match of matchAll(this.linkPattern, text)) {
const urlLink = extractDocumentLink(document, base, match[1].length, match[6], match.index);
if (urlLink) {
results.push(urlLink);
const matchImage = match[5] && extractDocumentLink(document, base, match[3].length + 1, match[5], match.index);
if (matchImage) {
results.push(matchImage);
}
const imgLink = match[5] && extractDocumentLink(document, base, match[3].length + 1, match[5], match.index);
if (imgLink) {
results.push(imgLink);
const matchLink = extractDocumentLink(document, base, match[1].length, match[6], match.index);
if (matchLink) {
results.push(matchLink);
}
}
return results;
Expand Down

0 comments on commit 9070abe

Please sign in to comment.