Skip to content

feat(core): block-owned HTML export post-processing - #3362

Open
nperez0111 wants to merge 2 commits into
testing/component-test-examplesfrom
plan-block-html-post-process-api
Open

nperez0111 wants to merge 2 commits into
testing/component-test-examplesfrom
plan-block-html-post-process-api

Conversation

@nperez0111

@nperez0111 nperez0111 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Why

The HTML serializer currently knows too much about specific blocks. It has special steps for numbered lists, checkboxes, toggles and tables, even though those details really belong to the blocks themselves.

Ideally, the serializer should just assemble the HTML. A block should be able to clean up its own output, whether it is a built-in block or a custom one.

Some of that cleanup needs the whole document, though. List numbering, for example, depends on the surrounding blocks, so it cannot happen while rendering each block in isolation.

What this changes

This adds a postProcessHTML hook to block implementations. It runs once per block type, after the full HTML has been assembled:

postProcessHTML({ root, blockOutputs }) {
  // Adjust this block type’s output, with the full document available.
}

root is the complete exported DOM. blockOutputs maps the rendered blocks of that type to their output nodes and elements, so the hook does not need to find or parse those blocks again.

The same hook runs for both HTML export methods. There is no format flag; a block can target the DOM structure it needs to adjust.

The existing list numbering, checkbox, toggle and table cleanup now lives with those blocks instead of in the internal serializer. This does not remove internal HTML serialization yet, but it moves us toward a serializer that does not need to know about individual block types.

Checked

  • Sub-agent review, with fixes reviewed again afterward.
  • Build, lint, unit and integration tests.
  • Browser tests in Chromium, Firefox and WebKit, including custom blocks, React blocks, nested lists, frames and fragment outputs.
  • Existing static-rendering visual baseline and documentation.
  • Full CI is green, including all browser and PDF suites and both deployments.

CI also exposed an existing color-inheritance failure on the base branch. A separate commit restores the missing CSS fallback colors; the existing tests now pass without changing their assertions.

@vercel

vercel Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
blocknote Ready Ready Preview Nov 16, 2026 5:28pm UTC
blocknote-website Ready Ready Preview Nov 16, 2026 5:28pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 705cf8c8-3e1b-415b-93b8-77b52b6efb6c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@pkg-pr-new

pkg-pr-new Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@blocknote/ariakit

npm i https://pkg.pr.new/@blocknote/ariakit@3362

@blocknote/code-block

npm i https://pkg.pr.new/@blocknote/code-block@3362

@blocknote/core

npm i https://pkg.pr.new/@blocknote/core@3362

@blocknote/diagram-block

npm i https://pkg.pr.new/@blocknote/diagram-block@3362

@blocknote/mantine

npm i https://pkg.pr.new/@blocknote/mantine@3362

@blocknote/math-block

npm i https://pkg.pr.new/@blocknote/math-block@3362

@blocknote/react

npm i https://pkg.pr.new/@blocknote/react@3362

@blocknote/server-util

npm i https://pkg.pr.new/@blocknote/server-util@3362

@blocknote/shadcn

npm i https://pkg.pr.new/@blocknote/shadcn@3362

@blocknote/xl-ai

npm i https://pkg.pr.new/@blocknote/xl-ai@3362

@blocknote/xl-docx-exporter

npm i https://pkg.pr.new/@blocknote/xl-docx-exporter@3362

@blocknote/xl-email-exporter

npm i https://pkg.pr.new/@blocknote/xl-email-exporter@3362

@blocknote/xl-multi-column

npm i https://pkg.pr.new/@blocknote/xl-multi-column@3362

@blocknote/xl-odt-exporter

npm i https://pkg.pr.new/@blocknote/xl-odt-exporter@3362

@blocknote/xl-pdf-exporter

npm i https://pkg.pr.new/@blocknote/xl-pdf-exporter@3362

@blocknote/xl-typst-exporter

npm i https://pkg.pr.new/@blocknote/xl-typst-exporter@3362

commit: 2ec2315

@nperez0111

Copy link
Copy Markdown
Contributor Author

CI follow-up: the only initial failures were 27 existing color-inheritance cases, also failing on the base branch (run 43469007818). Root cause was React CSS overriding core color fallbacks with unresolved theme variables outside a themed root. Commit 2ec2315 restores the same 18 fallbacks as core; themed values still take precedence. An independent sub-agent reviewed the fix (READY). Docker verification: 70 passed, 2 existing skips across Chromium, Firefox, and WebKit, including color inheritance, postProcessHTML, and static rendering. Watching the fresh full CI run.

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
PR Preview Action v1.8.2

QR code for preview link

🚀 View preview at
https://TypeCellOS.github.io/BlockNote/pr-preview/pr-3362/

Built to branch gh-pages at 2026-11-16 21:12 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

This branch was successfully deployed

2 active deployments
Preview – blocknote-website — 2ec23158 Deployed Nov 16, 2026 by vercel[bot]
Preview – blocknote — 2ec23158 Deployed Nov 16, 2026 by vercel[bot]
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.

1 participant