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; }