#841 - Remove dash on folder notation

This commit is contained in:
Elio Struyf
2024-09-18 09:20:54 +02:00
parent 121a84659f
commit 47dba5f510
2 changed files with 10 additions and 2 deletions
+5 -1
View File
@@ -272,7 +272,11 @@ export class Article {
let newFileName = `${slugName}${ext}`;
if (filePrefix && typeof filePrefix === 'string') {
newFileName = `${filePrefix}-${newFileName}`;
if (filePrefix.endsWith('/')) {
newFileName = `${filePrefix}${newFileName}`;
} else {
newFileName = `${filePrefix}-${newFileName}`;
}
}
const newPath = editor.document.uri.fsPath.replace(fileName, newFileName);
+5 -1
View File
@@ -551,7 +551,11 @@ export class ArticleHelper {
// Create a folder with the `index.md` file
if (contentType?.pageBundle) {
if (prefix && typeof prefix === 'string') {
sanitizedName = `${prefix}-${sanitizedName}`;
if (prefix.endsWith('/')) {
sanitizedName = `${prefix}${sanitizedName}`;
} else {
sanitizedName = `${prefix}-${sanitizedName}`;
}
}
const newFolder = join(folderPath, sanitizedName);