hotfix pagebreak

This commit is contained in:
Mateusz Gruszczyński
2026-09-12 10:34:13 +02:00
parent 295761123f
commit 86a6fa1f2f
3 changed files with 16 additions and 2 deletions
Generated
+1 -1
View File
@@ -2581,7 +2581,7 @@ dependencies = [
[[package]]
name = "rustpad"
version = "0.2.74"
version = "0.2.75"
dependencies = [
"argon2",
"aws-config",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "rustpad"
version = "0.2.74"
version = "0.2.75"
edition = "2024"
rust-version = "1.94"
description = "Collaborative Markdown notepad built with Axum, WebSockets and SQLite, PostgreSQL and MySQL"
+14
View File
@@ -530,12 +530,26 @@ function printStyles(cssSize, pageWidthMm, pageHeightMm, marginMm, preserveColor
}
.pdf-content .pdf-keep-unit {
/*
* Chromium can leave a 1-2 px fragment of an avoided block on the
* previous page before moving the real block to the next page.
* Making the keep unit an atomic inline-block prevents that ghost
* fragment while preserving book-like pagination.
*/
display: inline-block;
width: 100%;
vertical-align: top;
box-sizing: border-box;
break-inside: avoid-page;
page-break-inside: avoid;
}
.pdf-content .pdf-keep-unit > :first-child { margin-top: 0 !important; }
.pdf-content .pdf-keep-unit > :last-child { margin-bottom: 0 !important; }
.pdf-content .pdf-atomic-visual {
display: inline-block;
width: 100%;
vertical-align: top;
box-sizing: border-box;
break-before: avoid-page;
page-break-before: avoid;
}