Skip to content

Commit

Permalink
fix: Fix links in markdown preview (#481)
Browse files Browse the repository at this point in the history
  • Loading branch information
svsool committed Dec 12, 2021
1 parent eba15fc commit 0c2cb34
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,12 @@ export const findReferences = async (
return foundRefs;
};

export const getFileUrlForMarkdownPreview = (filePath: string): string =>
vscode.Uri.file(filePath).toString().replace('file://', '');
export const getFileUrlForMarkdownPreview = (filePathParam: string): string => {
const workspaceFolder = getWorkspaceFolder();
const filePath = workspaceFolder ? filePathParam.replace(workspaceFolder, '') : filePathParam;

return vscode.Uri.file(filePath).toString().replace('file://', '');
};

export const getImgUrlForMarkdownPreview = (imagePath: string): string =>
vscode.Uri.file(imagePath).toString().replace('file://', '');
Expand Down

0 comments on commit 0c2cb34

Please sign in to comment.