diff --git a/src/commands/Article.ts b/src/commands/Article.ts index fb417a2f..24ed1d2d 100644 --- a/src/commands/Article.ts +++ b/src/commands/Article.ts @@ -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); diff --git a/src/helpers/ArticleHelper.ts b/src/helpers/ArticleHelper.ts index c669903f..08cb735a 100644 --- a/src/helpers/ArticleHelper.ts +++ b/src/helpers/ArticleHelper.ts @@ -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);