From 32c33c9db3f2b9a12700fe38876f1e0fd0499e27 Mon Sep 17 00:00:00 2001 From: Steffen Becker Date: Thu, 25 Jun 2026 19:40:53 +0200 Subject: [PATCH] fix: missing empty lines in prints --- src/lib/export/pdf.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib/export/pdf.ts b/src/lib/export/pdf.ts index fa7594d..1f0c357 100644 --- a/src/lib/export/pdf.ts +++ b/src/lib/export/pdf.ts @@ -302,6 +302,11 @@ function buildBodyHtml(json: Json): string { } table.insertBefore(cg, table.firstChild); }); + // generateHTML omits ProseMirror's trailing
, so empty textblocks collapse to zero + // height and blank lines vanish in print. Re-add a break so each keeps a line. + host.querySelectorAll('p, h1, h2, h3').forEach((el) => { + if (!el.firstChild) el.appendChild(document.createElement('br')); + }); return host.innerHTML; }