hotfix pagebreak

This commit is contained in:
Mateusz Gruszczyński
2026-09-12 10:09:25 +02:00
parent f16a860f0a
commit 295761123f
5 changed files with 118 additions and 4 deletions
+14 -2
View File
@@ -427,15 +427,27 @@ function printStyles(cssSize, pageWidthMm, pageHeightMm, marginMm, preserveColor
box-sizing: border-box;
}
.pdf-content .preview-source-line::before { display: none !important; content: none !important; }
.pdf-content .preview-source-line { min-height: 0; }
.pdf-content .preview-source-line { min-height: 0; position: static !important; }
.pdf-content .preview-editable:hover,
.pdf-content .preview-editable:focus { background: transparent !important; box-shadow: none !important; }
.pdf-content a { color: inherit !important; text-decoration: underline; }
/* Book-like pagination: keep small semantic units together, not whole sections. */
/*
* Do not rely on break-after: avoid for the main Markdown headings.
* Chromium can first paint the heading at the end of the old page and
* then move it to the next page, leaving a clipped strip of glyphs behind.
* A small invisible reserve inside the heading keeps one following line
* with it without triggering that fragmentation bug.
*/
.pdf-content h1,
.pdf-content h2,
.pdf-content h3,
.pdf-content h3 {
break-after: auto;
page-break-after: auto;
padding-bottom: 1.15em;
margin-bottom: calc(.18em - 1.15em);
}
.pdf-content h4,
.pdf-content h5,
.pdf-content h6,