diff --git a/.changeset/purple-poems-melt.md b/.changeset/purple-poems-melt.md new file mode 100644 index 000000000..896eabd0d --- /dev/null +++ b/.changeset/purple-poems-melt.md @@ -0,0 +1,5 @@ +--- +'gitbook': patch +--- + +Prevent page breaks inside blocks when printing diff --git a/packages/gitbook/src/components/DocumentView/Blocks.tsx b/packages/gitbook/src/components/DocumentView/Blocks.tsx index be09f2b42..eddd11160 100644 --- a/packages/gitbook/src/components/DocumentView/Blocks.tsx +++ b/packages/gitbook/src/components/DocumentView/Blocks.tsx @@ -85,7 +85,7 @@ export function UnwrappedBlocks(props: UnwrappedBl key={node.key || `${node.type}-${index}`} block={node} style={[ - 'mx-auto page-width-wide:mx-0 w-full decoration-primary/6', + 'mx-auto page-width-wide:mx-0 w-full decoration-primary/6 print:break-inside-avoid', node.data && 'fullWidth' in node.data && node.data.fullWidth ? 'max-w-screen-2xl' : 'max-w-3xl',