From 63c503eedb1ea785b1d27f6003452bf687e5e3af Mon Sep 17 00:00:00 2001 From: IBG Date: Sun, 21 Apr 2024 20:51:55 +0800 Subject: [PATCH] Allow the publish command to handle files with filenames separated by spaces in the _draft folder. --- lib/hexo/post.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/hexo/post.ts b/lib/hexo/post.ts index 8e443b0283..66c54d863a 100644 --- a/lib/hexo/post.ts +++ b/lib/hexo/post.ts @@ -348,8 +348,7 @@ class Post { const { config } = ctx; const draftDir = join(ctx.source_dir, '_drafts'); const slug = slugize(data.slug.toString(), { transform: config.filename_case }); - data.slug = slug; - const regex = new RegExp(`^${escapeRegExp(slug)}(?:[^\\/\\\\]+)`); + const regex = new RegExp(`^${escapeRegExp(data.slug.toString())}(?:[^\\/\\\\]+)`); let src = ''; const result: Result = {};