From a9f436f9723aeaa75ed1e33b3d5bdb1e0ac37e98 Mon Sep 17 00:00:00 2001 From: Alexander Kucera Date: Wed, 5 Nov 2025 08:32:58 +0100 Subject: [PATCH] Simplifies path normalization for Windows compatibility Avoids double normalization of paths, which can lead to issues with Windows path handling, specifically with drive letters and forward slashes. --- src/core/TempDirectoryManager.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/core/TempDirectoryManager.ts b/src/core/TempDirectoryManager.ts index aacc57e..f782ec9 100644 --- a/src/core/TempDirectoryManager.ts +++ b/src/core/TempDirectoryManager.ts @@ -207,7 +207,7 @@ export class TempDirectoryManager { // Use path.join to properly handle absolute paths const result = path.join(pluginDir, dirName); - return normalizePath(path.normalize(result)); + return normalizePath(result); } /** @@ -442,10 +442,9 @@ export class TempDirectoryManager { public isPluginTempDir(dirPath: string): boolean { const pluginDir = this.getPluginDir(); const normalizedDirPath = normalizePath(dirPath); - const normalizedPluginDir = normalizePath(pluginDir); - const tempImagesDir = normalizePath(path.join(normalizedPluginDir, PLUGIN_DIRS.TEMP_IMAGES)); - const tempPandocDir = normalizePath(path.join(normalizedPluginDir, PLUGIN_DIRS.TEMP_PANDOC)); + const tempImagesDir = normalizePath(path.join(pluginDir, PLUGIN_DIRS.TEMP_IMAGES)); + const tempPandocDir = normalizePath(path.join(pluginDir, PLUGIN_DIRS.TEMP_PANDOC)); return normalizedDirPath.startsWith(tempImagesDir) || normalizedDirPath.startsWith(tempPandocDir);