Skip to content

Commit 68ee6c0

Browse files
committed
fix home relative URL creation
1 parent ba72220 commit 68ee6c0

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -982,19 +982,18 @@ export class BackLayerWebView<T extends ICommonCellInfo> extends Themable {
982982
}
983983

984984
if (href.startsWith('/')) {
985+
linkToOpen = await this.pathService.fileURI(href);
985986
const folders = this.workspaceContextService.getWorkspace().folders;
986987
if (folders.length) {
987-
linkToOpen = (await this.pathService.fileURI(href)).with({
988+
linkToOpen = linkToOpen.with({
988989
scheme: folders[0].uri.scheme,
989990
authority: folders[0].uri.authority
990991
});
991-
} else {
992-
linkToOpen = await this.pathService.fileURI(href);
993992
}
994993
} else if (href.startsWith('~')) {
995994
const userHome = await this.pathService.userHome();
996995
if (userHome) {
997-
linkToOpen = URI.parse(osPath.join(userHome.fsPath, href.substring(1)));
996+
linkToOpen = userHome.with({ path: osPath.join(userHome.fsPath, href.substring(1)) });
998997
}
999998
} else {
1000999
if (this.documentUri.scheme === Schemas.untitled) {

0 commit comments

Comments
 (0)