From 66c62fcce3ae80499a7cd65fb0817cae61148780 Mon Sep 17 00:00:00 2001 From: Charles Gagnon Date: Fri, 23 Jul 2021 12:33:45 -0700 Subject: [PATCH] Fix relative path check in HtmlMarkdownConverter (#16192) --- .../workbench/contrib/notebook/browser/htmlMarkdownConverter.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sql/workbench/contrib/notebook/browser/htmlMarkdownConverter.ts b/src/sql/workbench/contrib/notebook/browser/htmlMarkdownConverter.ts index 83916d8dad..07b9b4c138 100644 --- a/src/sql/workbench/contrib/notebook/browser/htmlMarkdownConverter.ts +++ b/src/sql/workbench/contrib/notebook/browser/htmlMarkdownConverter.ts @@ -312,7 +312,7 @@ export function findPathRelativeToContent(notebookFolder: string, contentPath: U relativePath = relativePath.replace(/\s/g, '%20'); // if relativePath contains improper directory format due to marked js parsing returning an invalid path (ex. ....\) then we need to replace it to ensure the directories are formatted properly (ex. ..\..\) relativePath = replaceInvalidLinkPath(relativePath); - if (relativePath.startsWith(path.join('..', path.sep) || path.join('.', path.sep))) { + if (relativePath.startsWith(path.join('..', path.sep)) || relativePath.startsWith(path.join('.', path.sep))) { return relativePath; } else { // if the relative path does not contain ./ at the beginning, we need to add it so it's recognized as a link