Skip to content

Commit d2fcb63

Browse files
authored
Replace colon to dash
Fixed an issue that could not be saved properly if the title included colon.
1 parent cff1fd4 commit d2fcb63

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crawler/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class Crawler {
7979
}
8080

8181
async writePost(post) {
82-
const path = join('backup', 'content', `${post.title.replace(/\//g, ' ')}.md`);
82+
const path = join('backup', 'content', `${post.title.replace(/\//g, ' ').replace(':','-')}.md`);
8383

8484
post.body = '---\n'
8585
+ `title: "${post.title}"\n`
@@ -116,4 +116,4 @@ class Crawler {
116116

117117
};
118118

119-
module.exports = Crawler;
119+
module.exports = Crawler;

0 commit comments

Comments
 (0)