Skip to content

Commit 160e6af

Browse files
author
Artem
committed
additionally normalize path (quick fix)
1 parent 31fe38f commit 160e6af

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

redisinsight/ui/src/utils/pathUtil.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ export const prepareTutorialDataFileUrlFromMd = (nodeUrl: string, mdPath: string
1515

1616
// process absolute path
1717
if (nodeUrl.startsWith('/') || nodeUrl.startsWith('\\')) {
18-
const paths = mdPath?.split('/') || []
18+
// todo: quick fix. find the root cause why path has both '/' and '\'
19+
const normalizedMdPath = mdPath.replaceAll('\\', '/')
20+
21+
const paths = normalizedMdPath?.split('/') || []
1922
let tutorialRootPath
2023
switch (paths[1]) {
2124
case TutorialsPaths.CustomTutorials:
@@ -26,7 +29,7 @@ export const prepareTutorialDataFileUrlFromMd = (nodeUrl: string, mdPath: string
2629
tutorialRootPath = paths.slice(0, 2).join('/')
2730
break
2831
default:
29-
tutorialRootPath = mdPath
32+
tutorialRootPath = normalizedMdPath
3033
break
3134
}
3235

0 commit comments

Comments
 (0)