From 2bb006d80efc1d4d7e584498b5b49095e4cc5c8b Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 1 Feb 2025 19:11:44 +0200 Subject: [PATCH 1/2] feat(print): better widows & orphans support --- src/public/stylesheets/print.css | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/public/stylesheets/print.css b/src/public/stylesheets/print.css index 2ff884440..3667e2c60 100644 --- a/src/public/stylesheets/print.css +++ b/src/public/stylesheets/print.css @@ -213,4 +213,18 @@ span[style] { .note-detail-printable .footnote-reference a, .footnote-back-link a { text-decoration: none; - } \ No newline at end of file + } + +/* + * Widows and orphans + */ +p, +blockquote { + widows: 4; + orphans: 4; +} + +pre > code { + widows: 6; + orphans: 6; +} \ No newline at end of file From 6ac868555f353483c7e8ea2a2c754c5a52a43554 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 1 Feb 2025 19:16:22 +0200 Subject: [PATCH 2/2] feat(print): fix widowed headings --- src/public/stylesheets/print.css | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/public/stylesheets/print.css b/src/public/stylesheets/print.css index 3667e2c60..6e0591be6 100644 --- a/src/public/stylesheets/print.css +++ b/src/public/stylesheets/print.css @@ -227,4 +227,9 @@ blockquote { pre > code { widows: 6; orphans: 6; +} + +h1, h2, h3, h4, h5, h6 { + page-break-after: avoid; + break-after: avoid; } \ No newline at end of file