#393 - Fix Windows file path

This commit is contained in:
Elio
2022-09-05 14:55:34 +02:00
parent 7392d7ea0d
commit fcb564b054
2 changed files with 7 additions and 2 deletions
+1
View File
@@ -38,6 +38,7 @@
### 🐞 Fixes
- [#354](https://github.com/estruyf/vscode-front-matter/issues/354): Fix Windows file path parsing for inserting media files
- [#393](https://github.com/estruyf/vscode-front-matter/issues/393): Fix Windows file path for retrieving the preview path
## [7.3.3] - 2022-06-11
+6 -2
View File
@@ -47,8 +47,9 @@ export class Preview {
let selectedFolder: ContentFolder | null = null;
for (const folder of foldersWithPath) {
if (filePath.startsWith(folder.path)) {
if (!selectedFolder || selectedFolder.path.length < folder.path.length) {
const folderPath = parseWinPath(folder.path);
if (filePath.startsWith(folderPath)) {
if (!selectedFolder || selectedFolder.path.length < folderPath.length) {
selectedFolder = folder;
}
}
@@ -79,6 +80,9 @@ export class Preview {
} catch (error) {
slug = join(pathname, slug);
}
// Make sure there are no backslashes in the slug
slug = parseWinPath(slug);
}
// Create the preview webview