fix: missing empty lines in prints

This commit is contained in:
Steffen Becker committed 2026-06-25 19:41:26 +02:00
1 parent a333fb85aa
commit 32c33c9db3
1 file changed
+5
+5
View File
@@ -302,6 +302,11 @@ function buildBodyHtml(json: Json): string {
}
table.insertBefore(cg, table.firstChild);
});
// generateHTML omits ProseMirror's trailing <br>, 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;
}