Skip to content

Commit 0bfc697

Browse files
committed
🐛(frontend) remove comments from print
When we print a document, we want to hide the comments and selection highlights. This is done by adding some CSS rules to the print styles.
1 parent 48ba77b commit 0bfc697

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/frontend/apps/impress/src/features/docs/doc-export/utils_print.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@ const PRINT_ONLY_CONTENT_CSS = `
3535
}
3636
3737
/* Hide selection highlights */
38-
.ProseMirror-yjs-selection {
38+
.ProseMirror-yjs-selection,
39+
.bn-thread-mark {
3940
background-color: transparent !important;
41+
border-bottom: none !important;
4042
}
4143
4244
/* Reset all layout containers for print flow */
@@ -299,7 +301,12 @@ export function printDocumentWithStyles() {
299301
setTimeout(() => {
300302
const cleanupLinks = wrapMediaWithLink();
301303
const cleanupInterlinks = wrapInterlinksWithAnchor();
304+
let cleaned = false;
302305
const cleanup = () => {
306+
if (cleaned) {
307+
return;
308+
}
309+
cleaned = true;
303310
cleanupInterlinks();
304311
cleanupLinks();
305312
cleanupPrintStyles();

0 commit comments

Comments
 (0)