fix: pptx encoding (#3905)
This commit is contained in:
parent
27ebd2e8cf
commit
fb0eb49196
@ -27,3 +27,4 @@ weight: 802
|
|||||||
1. 标签过滤时,子文件夹未成功过滤。
|
1. 标签过滤时,子文件夹未成功过滤。
|
||||||
2. 暂时移除 md 阅读优化,避免链接分割错误。
|
2. 暂时移除 md 阅读优化,避免链接分割错误。
|
||||||
3. 离开团队时,未刷新成员列表。
|
3. 离开团队时,未刷新成员列表。
|
||||||
|
4. PPTX 编码错误,导致解析失败。
|
||||||
@ -45,10 +45,12 @@ const parsePowerPoint = async ({
|
|||||||
|
|
||||||
// Returning an array of all the xml contents read using fs.readFileSync
|
// Returning an array of all the xml contents read using fs.readFileSync
|
||||||
const xmlContentArray = await Promise.all(
|
const xmlContentArray = await Promise.all(
|
||||||
files.map((file) => {
|
files.map(async (file) => {
|
||||||
return fs.promises.readFile(`${decompressPath}/${file.path}`, encoding).catch(() => {
|
try {
|
||||||
return fs.promises.readFile(`${decompressPath}/${file.path}`, 'utf-8');
|
return await fs.promises.readFile(`${decompressPath}/${file.path}`, encoding);
|
||||||
});
|
} catch (err) {
|
||||||
|
return await fs.promises.readFile(`${decompressPath}/${file.path}`, 'utf-8');
|
||||||
|
}
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user