Changes
Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
co-authored by
renee-png
parent
3f0fcd0bff
commit
56f67b55f3
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user