From d2fcb6373f2e64a8ea8275bd1d816c2bdc489ded Mon Sep 17 00:00:00 2001 From: 1111 <0x1306A8E@pm.me> Date: Mon, 8 Feb 2021 12:42:40 +0900 Subject: [PATCH] Replace colon to dash Fixed an issue that could not be saved properly if the title included colon. --- crawler/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crawler/index.js b/crawler/index.js index 8d0ca83..def334c 100644 --- a/crawler/index.js +++ b/crawler/index.js @@ -79,7 +79,7 @@ class Crawler { } async writePost(post) { - const path = join('backup', 'content', `${post.title.replace(/\//g, ' ')}.md`); + const path = join('backup', 'content', `${post.title.replace(/\//g, ' ').replace(':','-')}.md`); post.body = '---\n' + `title: "${post.title}"\n` @@ -116,4 +116,4 @@ class Crawler { }; -module.exports = Crawler; \ No newline at end of file +module.exports = Crawler;