From cbaffd0b0dad3e82a8195897f7bf746bf4d71626 Mon Sep 17 00:00:00 2001 From: Barbara Valdez <34872381+barbaravaldez@users.noreply.github.com> Date: Fri, 18 Feb 2022 10:08:33 -0800 Subject: [PATCH] fix section markdown and html link (#18478) * fix section markdown and html link --- .../notebook/browser/cellViews/linkHandler.directive.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sql/workbench/contrib/notebook/browser/cellViews/linkHandler.directive.ts b/src/sql/workbench/contrib/notebook/browser/cellViews/linkHandler.directive.ts index a4086fc0c5..134174d53a 100644 --- a/src/sql/workbench/contrib/notebook/browser/cellViews/linkHandler.directive.ts +++ b/src/sql/workbench/contrib/notebook/browser/cellViews/linkHandler.directive.ts @@ -73,11 +73,13 @@ export class LinkHandlerDirective { } } if (uri && this.openerService) { + // Store fragment before converting, since asFileUri removes the uri fragment + const fragment = uri.fragment; // Convert vscode-file protocol URIs to file since that's what Notebooks expect to work with uri = FileAccess.asFileUri(uri); if (this.isSupportedLink(uri)) { - if (uri.fragment && uri.fragment.length > 0 && uri.fsPath === this.workbenchFilePath.fsPath) { - this.notebookService.navigateTo(this.notebookUri, uri.fragment); + if (fragment && fragment.length > 0 && uri.fsPath === this.workbenchFilePath.fsPath) { + this.notebookService.navigateTo(this.notebookUri, fragment); } else { if (uri.scheme === 'file') { let exists = await this.fileService.exists(uri);