Skip to skills
AI Craft Pad
Home/Skills/Compare workflows/Portable Text: importing content versus rendering it
Practical comparisons

Portable Text: importing content versus rendering it

Sanity’s conversion and serialization skills address opposite sides of a content pipeline. They complement each other rather than compete for the same task.

Conversion defines the stored meaning

The conversion workflow takes HTML, Markdown or another source and constructs Portable Text blocks. Its concerns include unique keys, annotation references, list structure and mappings for custom content. This is the right starting point for an importer or migration. Keeping raw HTML in a string field may appear simpler, but it bypasses the structured representation the target editor expects.

Serialization defines the delivered experience

The rendering workflow maps stored blocks and marks to frontend components or output formats. A missing custom renderer cannot usually be fixed by changing unrelated source conversion. Conversely, a visually pleasing renderer can hide a broken annotation reference in stored content. Diagnose which side of the boundary is responsible before replacing libraries or rewriting the pipeline.

Share fixtures across the boundary

Keep examples with headings, nested lists, internal and external links, images, inline objects and unsupported blocks. Convert them into stored data, validate the structure and then render the exact result. Include long content, absent fields and unusual characters so that the happy-path example does not become the only acceptance test.

Verify structure and visible behavior

Compare semantic meaning as well as appearance. Check escaping and link schemes, accessible HTML and keyboard behavior. For migrations, confirm repeatability and reference integrity before cutover. These are source-based workflow comparisons; the catalog did not install the libraries, execute a migration or certify interoperability for every listed framework. Use the current framework-specific references when implementing the final renderer.

TaskStarting pointCheck before choosing
HTML or Markdown importPortable Text conversionValidate keys and annotation references
React, Vue or other frontend outputPortable Text serializationUse the matching framework reference
Missing custom blockTrace storage and renderer separatelyDo not silently drop content
Migration acceptanceBoth workflows with shared fixturesCheck semantic and visual fidelity

Read the source-based reviews

Development82/100

portable text conversion

sanity-io/agent-toolkit

A format-conversion guide for importing HTML or Markdown into Sanity Portable Text.

First-party sourceMITEditorial review
194 repo stars0 text flagsReview ↗
Development85/100

portable text serialization

sanity-io/agent-toolkit

A Portable Text rendering guide for mapping blocks, marks and custom content to frontend components.

First-party sourceMITEditorial review
194 repo stars1 text flagReview ↗