function

MapDocumentBlocks

MapDocumentBlocks copies the editor tree while explicitly converting each typed block payload. Pass the generated output payload's Retain method to make an update document: only block identities are retained, so omitted, redacted, localized and populated fields are never copied into a write. Edit returned update payloads and save with the parent document's revision.

Arguments

ArgumentTypeDescription
documentDocument[From]The document value.
convertfunc(From) (To, error)The convert value.

Returns

The declared result.

(Document[To], error)

Full signature

func MapDocumentBlocks[From, To any]( document Document[From], convert func(From) (To, error), ) (Document[To], error)

Source plugins/richtext/document_map.go:10

Related types

  • Document

    The exact generated Go value type for a versioned serialized Lexical document.