Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

通过同步助手导出时,特殊符号的标题会导出失败 #2466

Closed
binsee opened this issue Jun 29, 2021 · 5 comments
Closed

通过同步助手导出时,特殊符号的标题会导出失败 #2466

binsee opened this issue Jun 29, 2021 · 5 comments

Comments

@binsee
Copy link
Contributor

binsee commented Jun 29, 2021

请说明发生问题的环境

简悦包含了很多平台的版本,所以为了方便定位,建议告诉我一些必要信息

请描述你的问题

  • 文章标题含有特殊符号 ",使用同步助手导出为pdf,导出失败。
    从同步助手返回的错误如下:
{
    "status": -1,
    "error": {
        "errno": -4058,
        "code": "ENOENT",
        "syscall": "open",
        "path": "E:\\xxx\\坚果云\\SimpRead\\output\\tmp-55-3rd-party \"Tracked In\" should be less prominent · Discussion #4306 · github-feedback.feedback.html"
    }
}

经过测试," 符号,在Win平台下为非法文件名,在macOS下为合法。

截图

image

@binsee
Copy link
Contributor Author

binsee commented Jun 29, 2021

更新同步助手到最新的1.0.1后,可以生成pdf,但pdf内容是非预期的

Error: ENOENT: no such file or directory, stat 'E:\xxx\坚果云\SimpRead\output\tmp-3rd-party Tracked In should be less prominent · Discussion .html

实际生成的临时文件:tmp-3rd-party Tracked In should be less prominent · Discussion #4306 · github-feedback.feedback.html
生成pdf时加载的文件:tmp-3rd-party Tracked In should be less prominent · Discussion .html

目前怀疑此问题与 #2467 的一样,是由于 # 符号需要被转义引发

@binsee
Copy link
Contributor Author

binsee commented Jun 29, 2021

目前怀疑此问题与 #2467 的一样,是由于 # 符号需要被转义引发

已经确认按此方式可以解决:

//同步助手 src/main/print.js

// pdf.loadURL(url + '/' + title );
// 修改为如下:
pdf.loadURL(url + '/' + encodeURIComponent(title) );

@Kenshin
Copy link
Owner

Kenshin commented Jun 29, 2021

收到,考虑近期升级一次同步助手。

@Kenshin
Copy link
Owner

Kenshin commented Jun 29, 2021

#2467 一致的话,就只留一个吧。

@Kenshin
Copy link
Owner

Kenshin commented Jun 9, 2022

嗨,此问题也修复了~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants