From 0bfc69747680783b2a8ea0804fa90160f45c4dde Mon Sep 17 00:00:00 2001 From: Anthony LC Date: Tue, 19 May 2026 22:04:44 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B(frontend)=20remove=20comments=20fr?= =?UTF-8?q?om=20print?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .../impress/src/features/docs/doc-export/utils_print.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/frontend/apps/impress/src/features/docs/doc-export/utils_print.ts b/src/frontend/apps/impress/src/features/docs/doc-export/utils_print.ts index b8b5760ee..a19d92c54 100644 --- a/src/frontend/apps/impress/src/features/docs/doc-export/utils_print.ts +++ b/src/frontend/apps/impress/src/features/docs/doc-export/utils_print.ts @@ -35,8 +35,10 @@ const PRINT_ONLY_CONTENT_CSS = ` } /* Hide selection highlights */ - .ProseMirror-yjs-selection { + .ProseMirror-yjs-selection, + .bn-thread-mark { background-color: transparent !important; + border-bottom: none !important; } /* Reset all layout containers for print flow */ @@ -299,7 +301,12 @@ export function printDocumentWithStyles() { setTimeout(() => { const cleanupLinks = wrapMediaWithLink(); const cleanupInterlinks = wrapInterlinksWithAnchor(); + let cleaned = false; const cleanup = () => { + if (cleaned) { + return; + } + cleaned = true; cleanupInterlinks(); cleanupLinks(); cleanupPrintStyles();