diff --git a/apps/web/src/components/sandbox/content/blog/blocks/block-registry.tsx b/apps/web/src/components/sandbox/content/blog/blocks/block-registry.tsx index cd85aaa58c..882621cb84 100644 --- a/apps/web/src/components/sandbox/content/blog/blocks/block-registry.tsx +++ b/apps/web/src/components/sandbox/content/blog/blocks/block-registry.tsx @@ -29,6 +29,11 @@ import { str } from "./primitives"; export type RawBlock = { __resolveType?: string } & Record; +/** A block field that's already a JSON string, or an array/object to stringify. */ +function jsonStr(value: unknown): string { + return typeof value === "string" ? value : JSON.stringify(value ?? []); +} + /** * Render a single block as its native, inline-editable representation * (Notion-style). Common blocks get bespoke editors matched by component @@ -141,11 +146,7 @@ export function BlockEditor({ case "CardGroup": return ( onChange({ ...block, cards })} /> ); @@ -176,16 +177,8 @@ export function BlockEditor({ case "Table": return ( onChange({ ...block, ...next })} /> );