Skip to content

htmlToBlocks

htmlToBlocks(html, schemaType, options): Omit<TypedObject | PortableTextTextBlock<TypedObject | PortableTextSpan>, "_key"> & object[]

Defined in: block-tools/src/index.ts:17

Convert HTML to blocks respecting the block content type’s schema

string

The HTML to convert to blocks

A compiled version of the schema type for the block content

ArraySchemaType<unknown> | Schema

HtmlDeserializerOptions = {}

Options for deserializing HTML to blocks

Omit<TypedObject | PortableTextTextBlock<TypedObject | PortableTextSpan>, "_key"> & object[]

Array of blocks