Skip to content

Version Packages - #3256

Open
ecoscript[bot] wants to merge 1 commit into
mainfrom
changeset-release/main
Open

Version Packages#3256
ecoscript[bot] wants to merge 1 commit into
mainfrom
changeset-release/main

Conversation

@ecoscript

@ecoscript ecoscript Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@portabletext/markdown@2.2.0

Minor Changes

  • #3255 02e2d49 Thanks @christianhg! - feat: gate the default markdown renderers on the schema in portableTextToMarkdown

    portableTextToMarkdown now accepts an optional schema. When set, each built-in type renderer (callout, code, horizontal-rule, html, image, table) runs only when the schema declares that type at the matching position (blockObjects for a block, inlineObjects for an inline object); an undeclared type falls back to unknownType, whose default output is a json:object fence (or tagged code span, inline) that reparses back to the same value under the same schema. Renderers you pass in types are never gated. The gate checks the type name only, so declare each type with its fields: markdownToPortableText cannot rebuild a value from a fieldless declaration. Omit schema and every default renderer stays active, as before.

    import {compileSchema, defineSchema} from '@portabletext/schema'
    import {portableTextToMarkdown} from '@portabletext/markdown'
    
    const schema = compileSchema(
      defineSchema({
        blockObjects: [
          {
            name: 'code',
            fields: [
              {name: 'code', type: 'string'},
              {name: 'language', type: 'string'},
            ],
          },
        ],
      }),
    )
    
    portableTextToMarkdown(blocks, {schema})
    // a `code` block renders as a fenced code block; a `table` block
    // (undeclared) renders as a `json:object` fence instead

    Pass the same schema to markdownToPortableText to keep the round trip consistent.

Patch Changes

  • #3265 3b2d278 Thanks @christianhg! - fix: serialize images the parser would refuse as json:object fences

    An image whose src a Markdown parser would refuse (a data: URI outside png/gif/jpeg/webp, or a javascript:/vbscript:/file: URI) previously serialized as ![alt](src) anyway; reparsing that markdown turned the image into literal text instead of an image object, destroying it. Such an image now serializes as a json:object fence (or, inline, a tagged code span), which reparses back to the identical image value. Images with an accepted src are unaffected.

  • #3255 d39146e Thanks @christianhg! - fix: use the inline json:object carrier for objects inside table cells

    In portableTextToMarkdown, an object inside a table cell that renders through the json:object carrier now uses the carrier's single-line inline form instead of a block fence squashed with <br>.

    In markdownToPortableText, a carrier object standing alone in a table cell is placed by the schema: it comes back at block position in the cell (cell.value), unless the schema declares the type inline-only, in which case it stays an inline child of the cell's text block. The same placement rule now governs standalone images, so under a schema without a block-level image, an image alone in a cell stays inline (reported as image-block-to-inline) instead of being lifted to block position.

    Together the two sides make objects in table cells survive the serialize-edit-reparse round trip.

  • #3264 deccf84 Thanks @christianhg! - fix: emit no blank lines for empty text blocks

    A block that renders to the empty string (an empty or whitespace-only text block, or a custom renderer returning '') no longer leaves blank lines in portableTextToMarkdown's output: [h1 'foo', empty block, 'bar'] now serializes to # foo\n\nbar instead of # foo\n\n\n\nbar. A dropped block never survived reparsing anyway, and a custom blockSpacing callback now sees the pair of blocks that actually end up adjacent, never an invisible one. Two spacing consequences show in rendered HTML: two blockquotes separated only by an empty block now join into one quote with a paragraph break, and a list whose blank lines came only from empty blocks goes tight, since a skipped block no longer counts toward looseness.

    The same filter runs inside containers: callout and structured-blockquote content joins skip empty blocks, so no more blank quote-prefixed lines. In list items, the marker line goes to the first block that renders output, with two exceptions that keep the markdown reparseable: a multi-line block (a code fence, a table) keeps its later lines indented inside the item instead of escaping the list at column 0, and a nested list or, on a task item, any non-text block stays indented below a bare marker, because after - [x] (or fused with - ) it would reparse as plain words.

@portabletext/editor@8.1.4

Patch Changes

  • #3257 df4b4ac Thanks @christianhg! - fix: remove the local placeholder on a remote root insert after a self-emitted unset

    After clearing the field under a value-mirroring host, a collaborator's block arriving through patches no longer leaves an extra empty block in the editor; the editor shows only the collaborator's content. One additional change: an empty block that a host genuinely persisted in the window after the editor's own unset is now removed from the editor when a remote root insert arrives, until the next value sync restores it; distinguishing it from the editor's own placeholder takes provenance metadata, which is follow-up work.

  • #3253 a4bea35 Thanks @christianhg! - fix: re-materialize the field before patches emitted while it is unset

    A behavior replacing the whole value in one action set (a root unset followed by an insert) previously emitted a patch stream that patch-applying stores could not apply: an insert into a field the preceding unset had removed. Consumers saw Cannot apply deep operations on primitive values.

    One narrow behavioral fix rides along: clearing the editor through a behavior-raised root unset now re-materializes the field on the next edit under a value-mirroring host, the same way clearing it with the keyboard already did.

@portabletext/plugin-character-pair-decorator@9.0.9

Patch Changes

  • Updated dependencies []:
    • @portabletext/plugin-input-rule@7.0.9

@portabletext/plugin-dnd@2.0.10

Patch Changes

  • fix(deps): require @portabletext/editor@^8.1.4

@portabletext/plugin-emoji-picker@8.0.9

Patch Changes

  • Updated dependencies []:
    • @portabletext/plugin-input-rule@7.0.9

@portabletext/plugin-input-rule@7.0.9

Patch Changes

  • fix(deps): require @portabletext/editor@^8.1.4

@portabletext/plugin-list-index@2.0.8

Patch Changes

  • fix(deps): require @portabletext/editor@^8.1.4

@portabletext/plugin-markdown-shortcuts@9.0.9

Patch Changes

  • Updated dependencies []:
    • @portabletext/plugin-character-pair-decorator@9.0.9
    • @portabletext/plugin-input-rule@7.0.9

@portabletext/plugin-one-line@8.0.8

Patch Changes

  • fix(deps): require @portabletext/editor@^8.1.4

@portabletext/plugin-paste-link@5.0.8

Patch Changes

  • fix(deps): require @portabletext/editor@^8.1.4

@portabletext/plugin-sdk-value@8.1.3

Patch Changes

  • fix(deps): require @portabletext/editor@^8.1.4

@portabletext/plugin-table@2.0.8

Patch Changes

  • fix(deps): require @portabletext/editor@^8.1.4

@portabletext/plugin-typeahead-picker@7.0.9

Patch Changes

  • Updated dependencies []:
    • @portabletext/plugin-input-rule@7.0.9

@portabletext/plugin-typography@9.0.9

Patch Changes

  • Updated dependencies []:
    • @portabletext/plugin-input-rule@7.0.9

@portabletext/toolbar@9.0.9

Patch Changes

  • fix(deps): require @portabletext/editor@^8.1.4

@vercel

vercel Bot commented Sep 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
portable-text-editor-documentation Ready Ready Preview Sep 11, 2026 7:03am UTC
portable-text-example-basic Ready Ready Preview Sep 11, 2026 7:03am UTC
portable-text-playground Ready Ready Preview Sep 11, 2026 7:03am UTC

Request Review

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Bundle Stats

✅ No significant changes.

All scenario measurements (7)

🗺️ @portabletext/editor / @portabletext/editor · @portabletext/editor / @portabletext/editor/behaviors · @portabletext/editor / @portabletext/editor/plugins · @portabletext/editor / @portabletext/editor/selectors · @portabletext/editor / @portabletext/editor/traversal · @portabletext/editor / @portabletext/editor/utils · @portabletext/markdown / @portabletext/markdown · Artifacts

Scenario Kind Bundle (raw / gzip) Gzip change Import time Import change
⚪ @portabletext/editor / @portabletext/editor export 1.09 MB / 254.3 KB None 70 ms +0 ms, +0.4%
⚪ @portabletext/editor / @portabletext/editor/behaviors export 4.0 KB / 1.4 KB None 2 ms -0 ms, -3.2%
⚪ @portabletext/editor / @portabletext/editor/plugins export 5.1 KB / 1.8 KB None 7 ms +0 ms, +1.0%
⚪ @portabletext/editor / @portabletext/editor/selectors export 94.7 KB / 21.7 KB None 8 ms +0 ms, +2.2%
⚪ @portabletext/editor / @portabletext/editor/traversal export 42.8 KB / 11.2 KB None 6 ms +0 ms, +0.1%
⚪ @portabletext/editor / @portabletext/editor/utils export 33.8 KB / 9.1 KB None 6 ms +0 ms, +0.3%
⚪ @portabletext/markdown / @portabletext/markdown export 314.5 KB / 91.4 KB None 45 ms +2 ms, +4.8%

Significant means at least 1.0 KB and 1% gzip, or at least 5 ms and 10% import time.

@ecoscript
ecoscript Bot force-pushed the changeset-release/main branch from 5fa1ea7 to 8094a84 Compare September 9, 2026 09:37
@ecoscript
ecoscript Bot force-pushed the changeset-release/main branch from 8094a84 to 84aea8c Compare September 9, 2026 10:40
@ecoscript
ecoscript Bot force-pushed the changeset-release/main branch from 84aea8c to 573d663 Compare September 10, 2026 07:03
@ecoscript
ecoscript Bot force-pushed the changeset-release/main branch from 573d663 to 216de93 Compare September 10, 2026 09:28
@ecoscript
ecoscript Bot force-pushed the changeset-release/main branch from 216de93 to 5834dca Compare September 10, 2026 12:10
@ecoscript
ecoscript Bot force-pushed the changeset-release/main branch from 5834dca to f91d0ff Compare September 11, 2026 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants