Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vscode-cnb",
"displayName": "博客园 cnblogs 客户端",
"description": "Cnblogs Client For VSCode",
"version": "0.0.1",
"version": "1.8.58",
"license": "LICENSE.txt",
"preview": false,
"publisher": "cnblogs",
Expand Down
3 changes: 3 additions & 0 deletions src/cmd/post-list/post-pull.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ export async function postPull(input: InputType, showConfirm = true, mute = fals
}

let uriPath = PostFileMapManager.getFilePath(post.id)

if (uriPath != null && uriPath.indexOf('#') < 0 && post.title.indexOf('#') >= 0) uriPath = undefined

let fileUri: Uri
if (uriPath == null) {
fileUri = PostFileMapManager.buildLocalPostFileUri(post)
Expand Down
3 changes: 2 additions & 1 deletion src/service/post/post-file-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ export namespace PostFileMapManager {
export function buildLocalPostFileUri(post: Post, appendToFileName = ''): Uri {
const workspaceUri = WorkspaceCfg.getWorkspaceUri()
const ext = `${post.isMarkdown ? 'md' : 'html'}`
let postTitle = sanitizeFileName(post.title)
let postTitle = post.title.replace(/#/g, '#')
postTitle = sanitizeFileName(postTitle)
if (/\.\d+$/.test(postTitle)) postTitle += '_'
return Uri.joinPath(workspaceUri, `${postTitle}${appendToFileName}.${post.id}.${ext}`)
}
Expand Down
Loading