Skip to content

fix: preserve leading whitespace in PDF output using nbsp #1860

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Martinrsts
Copy link
Contributor

Small fix to make leading whitespaces in pdf to render correctly.

Copy link

vercel bot commented Jul 19, 2025

@Martinrsts is attempting to deploy a commit to the TypeCell Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

pkg-pr-new bot commented Jul 19, 2025

Open in StackBlitz

@blocknote/ariakit

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/ariakit@1860

@blocknote/code-block

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/code-block@1860

@blocknote/core

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/core@1860

@blocknote/mantine

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/mantine@1860

@blocknote/react

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/react@1860

@blocknote/server-util

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/server-util@1860

@blocknote/shadcn

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/shadcn@1860

@blocknote/xl-ai

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-ai@1860

@blocknote/xl-docx-exporter

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-docx-exporter@1860

@blocknote/xl-email-exporter

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-email-exporter@1860

@blocknote/xl-multi-column

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-multi-column@1860

@blocknote/xl-odt-exporter

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-odt-exporter@1860

@blocknote/xl-pdf-exporter

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-pdf-exporter@1860

commit: 9eca3a8

@nperez0111
Copy link
Contributor

Thanks for the PR @Martinrsts, I'm not entirely sure what situations this fix would be relevant in. Can you describe a scenario that was broken in the previous behavior that works in this new behavior?

@Martinrsts
Copy link
Contributor Author

Yes no problem. I use whitespaces at the beggining of new lines to represent indentation or align text. Without the change, if there is ' ' characters at the beginning of the line, they are all replaced by only one ' '. Here is an example:

Screenshot of the editor:
Captura de pantalla 2025-07-21 112540

Screenshot of the PDF exportation without this PR:
Captura de pantalla 2025-07-21 112705

Screenshot of the PDF exportation with this PR
Captura de pantalla 2025-07-21 112548

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.

2 participants