diff --git a/src/io/wordOffice.test.ts b/src/io/wordOffice.test.ts index f8eb518..5e9a703 100644 --- a/src/io/wordOffice.test.ts +++ b/src/io/wordOffice.test.ts @@ -349,6 +349,33 @@ describe("wordOffice helpers", () => { ]); }); + it("сохраняет пустые ячейки и строки таблицы для DOCX", async () => { + const html = ` +
| Итог | ||
Normal Large Pixel size
diff --git a/src/io/wordOffice.ts b/src/io/wordOffice.ts index db9b92e..560b2e1 100644 --- a/src/io/wordOffice.ts +++ b/src/io/wordOffice.ts @@ -647,11 +647,7 @@ function parseHtmlFragment(html: string) { function tableRows(table: Element) { return Array.from(table.querySelectorAll("tr")) - .map((row) => - Array.from(row.querySelectorAll("th,td")) - .map(elementText) - .filter((cell) => cell.length > 0) - ) + .map((row) => Array.from(row.querySelectorAll("th,td")).map(elementText)) .filter((row) => row.length > 0); }