Skip to content

Prevent page breaks inside blocks when printing #3507

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

Conversation

nolannbiron
Copy link
Member

@nolannbiron nolannbiron commented Jul 28, 2025

Before:
CleanShot 2025-07-28 at 17 57 34@2x

After:
CleanShot 2025-07-28 at 17 57 20@2x

Copy link

linear bot commented Jul 28, 2025

Copy link

changeset-bot bot commented Jul 28, 2025

🦋 Changeset detected

Latest commit: a8abe1d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
gitbook Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds CSS styling to prevent page breaks from occurring inside content blocks when printing documents. This improves the print experience by ensuring blocks remain intact across page boundaries.

  • Adds print:break-inside-avoid CSS class to block elements
  • Creates a changeset documenting this print enhancement

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/gitbook/src/components/DocumentView/Blocks.tsx Adds print-specific CSS class to prevent page breaks inside blocks
.changeset/purple-poems-melt.md Documents the print enhancement as a patch-level change

Copy link

argos-ci bot commented Jul 28, 2025

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
customers-v2 (Inspect) 👍 Changes approved 3 changed Jul 28, 2025, 3:32 PM
v2-cloudflare (Inspect) 👍 Changes approved 1 changed Jul 28, 2025, 3:38 PM
v2-vercel (Inspect) ✅ No changes detected - Jul 28, 2025, 3:34 PM

@nolannbiron nolannbiron enabled auto-merge (squash) July 28, 2025 15:54
@nolannbiron nolannbiron merged commit d024658 into main Jul 28, 2025
15 of 16 checks passed
@nolannbiron nolannbiron deleted the nolann/rnd-7748-pdf-splits-images-and-some-blocks-across-pages branch July 28, 2025 16:08
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