Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-04-18 18:31:41 +00:00
co-authored by renee-png
parent 0aa50282dd
commit 8b64649cf8
+13 -1
View File
@@ -715,10 +715,22 @@ export function CustomFormBuilder() {
if (tag === "ol") return pushListItems(el, true, 0);
if (tag === "ul") return pushListItems(el, false, 0);
if (["p", "h1", "h2", "h3"].includes(tag)) {
const align = (el.style.textAlign as any) || "left";
const align = ((el.style.textAlign as any) || "left") as
| "left"
| "center"
| "right"
| "justify";
const indentPx = parseInt(el.style.paddingLeft || "0", 10) || 0;
const caption = el.getAttribute("data-caption") === "true";
const heading = tag === "h1" ? 1 : tag === "h2" ? 2 : tag === "h3" ? 3 : 0;
// If the block contains an <img>, emit it as a separate image segment
const imgs = Array.from(el.querySelectorAll("img"));
if (imgs.length > 0) {
const imgAlign: "left" | "center" | "right" =
align === "center" ? "center" : align === "right" ? "right" : "left";
imgs.forEach((img) => parseImg(img as HTMLImageElement, imgAlign));
return;
}
out.push({
kind: "text",
runs: mergeRuns(collectRuns(el)),