Rich text / foldkit-richtext
promoteUnknown
function · packages/richtext/src/migration.ts:148
function promoteUnknown(
name: string,
from: string,
to: string,
Props: Schema.Codec<any, any, never>,
children?: ContentMode,
): MigrationA migration from a preserved unknown block into a declared node kind: the props are decoded by the target's own schema, and a block whose data does not decode is left alone rather than half-converted. The target's content mode decides whether the promoted node holds runs or (empty) nested blocks, so promoting into a container kind produces a valid block rather than one the Kit will call a mismatch.