mirror of
https://github.com/estruyf/vscode-front-matter.git
synced 2026-08-02 06:52:34 +02:00
#841 - Remove dash on folder notation
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user