diff --git a/src/components/forms/custom-form-builder.tsx b/src/components/forms/custom-form-builder.tsx index e1800e4..0a9ec22 100644 --- a/src/components/forms/custom-form-builder.tsx +++ b/src/components/forms/custom-form-builder.tsx @@ -378,14 +378,18 @@ export function CustomFormBuilder() { const pushBlock = (el: HTMLElement) => { const tag = el.tagName.toLowerCase(); if (tag === "table") { - const rows: string[][] = []; - let hasHeader = false; + const rows: TableCellSeg[][] = []; el.querySelectorAll("tr").forEach((tr) => { const cells = Array.from(tr.children) as HTMLElement[]; - if (cells.some((c) => c.tagName.toLowerCase() === "th")) hasHeader = true; - rows.push(cells.map(cellText)); + rows.push( + cells.map((c) => ({ + text: cellText(c), + borders: parseBordersFromAttr(c.getAttribute("data-borders") ?? "trbl"), + isHeader: c.tagName.toLowerCase() === "th", + })), + ); }); - out.push({ kind: "table", rows, hasHeader }); + out.push({ kind: "table", rows }); return; } if (["p", "h1", "h2", "h3", "li"].includes(tag)) {