🐛 文档标题以空格结尾时导出 HTML 报错 Fix https://github.com/siyuan-note/siyuan/issues/6686

This commit is contained in:
Liang Ding 2022-11-23 17:00:51 +08:00
parent fdd9973d24
commit 3cc4ad6bff
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
2 changed files with 4 additions and 1 deletions

View file

@ -447,7 +447,8 @@ const getExportPath = (option: { type: string, id: string }, removeAssets?: bool
} else if (option.type === "word") {
url = "/api/export/exportDocx";
}
const savePath = result.filePaths[0].endsWith(response.data.rootTitle) ? result.filePaths[0] : path.join(result.filePaths[0], replaceLocalPath(response.data.rootTitle));
let savePath = result.filePaths[0].endsWith(response.data.rootTitle) ? result.filePaths[0] : path.join(result.filePaths[0], replaceLocalPath(response.data.rootTitle));
savePath = savePath.trim();
fetchPost(url, {
id: option.id,
pdf: option.type === "pdf",