Skip to content

Conversation

@AntoLC
Copy link
Collaborator

@AntoLC AntoLC commented Dec 30, 2025

Purpose

To avoid regression issues in PDF export functionality, this PR introduces end-to-end tests that compare exported PDFs against known good reference files.
We compare the PDF on most of the blocks that the editor supports.

⚠️ If during a Blocknote release or pull request there are intentional changes, the reference files would need to be updated accordingly. It can be done by uncommenting the line in the test that saves the newly generated PDF to the assets folder.

// If we need to update the PDF regression fixture, uncomment the line below
//await savePDFToAssetFolder(download);

Proposal

  • ⚡️(export) improve svg width when undefined
  • ✅(export) add PDF regression tests
  • ✅(export) simplify export testing
  • 🐛(export) fix heading 4 5 6 in PDF

Demo

What we test

image

doc-export-regressions.pdf

@github-actions
Copy link

github-actions bot commented Dec 30, 2025

Size Change: +71 B (0%)

Total Size: 4.16 MB

Filename Size Change
apps/impress/out/_next/static/6f289eba/_buildManifest.js 0 B -890 B (removed) 🏆
apps/impress/out/_next/static/05574861/_buildManifest.js 890 B +890 B (new file) 🆕

compressed-size-action

Copy link
Collaborator

@Ovgodd Ovgodd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm !

@AntoLC AntoLC force-pushed the feat/export-regression-testing branch from 9cb6bc1 to 2da302d Compare January 8, 2026 10:27
AntoLC added 4 commits January 8, 2026 11:32
We improved the svg width calculation when the
width attribute is undefined by trying to use
the style attribute before falling back to a
default value.
To avoid regression issues in PDF export
functionality, this commit introduces end-to-end
tests that compare exported PDFs against
known good reference files.
We compare the PDF on most of the blocks
that the editor supports.
If during a Blocknote release or pull request
there are intentional changes, the reference
files would need to be updated accordingly.
It can be done by uncommenting the line
in the test that saves the newly generated
PDF to the assets folder.
The regression test is asserting most of the
blocks of the editor, we can remove some redundant
tests.
We improved as well the odt and docx tests by
overriding as well the document content like for pdf,
it will assert more blocks and have less code
to maintain.
Heading 4 5 6 in PDF were not correctly
mapped to their corresponding styles in the
exported document.
The new export is now different than the regression
pdf, we need to update the regression PDF to match
the new correct export.
@AntoLC AntoLC force-pushed the feat/export-regression-testing branch from 2da302d to f9c9e44 Compare January 8, 2026 10:33
@AntoLC AntoLC merged commit f9c9e44 into main Jan 8, 2026
27 of 28 checks passed
@AntoLC AntoLC deleted the feat/export-regression-testing branch January 8, 2026 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants