Skip to content

fix(#664): 修复目录或文件名包含特殊字符‘&’时,笔记同步功能失效问题#669

Merged
codexu merged 1 commit intocodexu:devfrom
steven-jianhao-li:dev
Sep 26, 2025
Merged

fix(#664): 修复目录或文件名包含特殊字符‘&’时,笔记同步功能失效问题#669
codexu merged 1 commit intocodexu:devfrom
steven-jianhao-li:dev

Conversation

@steven-jianhao-li
Copy link
Copy Markdown
Contributor

issue: #664
之前文件名和路径只是通过将空格替换为下划线来过滤。这不足以处理其他特殊字符(例如&),这会导致GitHub API请求url出错。

这是个简单提交,在uploadFilegetFilesdeleteFilegetFileCommits函数中使用encodeURIComponent封装了文件名和路径。这确保所有特殊字符都被正确编码,防止API在处理具有非标准名称的文件时失败。

Previously, filenames and paths were only sanitized by replacing spaces with underscores. This was insufficient for handling other special characters (e.g., &), which could lead to broken GitHub API request URLs.

This commit wraps filenames and paths with encodeURIComponent in the uploadFile, getFiles, deleteFile, and getFileCommits functions. This ensures all special characters are properly encoded, preventing API failures when handling files with non-standard names.

@codexu codexu merged commit adcf54e into codexu:dev Sep 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants