This commit is contained in:
2026-06-09 17:46:33 +08:00
parent b56d5aa105
commit ec4a59eedb
7 changed files with 600 additions and 220 deletions

View File

@@ -964,6 +964,7 @@ str = str.replace(regex, function (match, content, offset, fullString) {
const documentFile = zip.file("word/document.xml");
if (!documentFile) {
console.error("❌ 找不到 word/document.xml无法解析 Word 文件");
callback([]);
return;
}
const relsFile = zip.file("word/_rels/document.xml.rels");
@@ -997,7 +998,8 @@ str = str.replace(regex, function (match, content, offset, fullString) {
const allTables = [];
if (!tables || tables.length === 0) {
console.warn("未找到表格内容,请检查 XML 结构");
return [];
callback([]);
return;
}
for (const table of tables) {
const rows = table.getElementsByTagNameNS(namespace, "tr");