Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-04-18 02:09:55 +00:00
co-authored by renee-png
parent 3f0fcd0bff
commit 56f67b55f3
+9 -5
View File
@@ -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)) {