Skip to content

Build your personal knowledge base with Trilium Notes

fix(client/print): ckeditor stylesheet missing

Elian Doranf0fa55715c0b
diff --git a/apps/client/src/print.tsx b/apps/client/src/print.tsx
index 96cf061323..86d98b1130 100644
--- a/apps/client/src/print.tsx
+++ b/apps/client/src/print.tsx
@@ -45,12 +45,15 @@ function SingleNoteRenderer({ note, onReady }: RendererProps) {
const containerRef = useRef<HTMLDivElement>(null);
useLayoutEffect(() => {
- content_renderer.getRenderedContent(note, {
- noChildrenList: true
- }).then(({$renderedContent}) => {
+ async function load() {
+ if (note.type === "text") {
+ await import("@triliumnext/ckeditor5/src/theme/ck-content.css");
+ }
+ const { $renderedContent } = await content_renderer.getRenderedContent(note, { noChildrenList: true });
containerRef.current?.replaceChildren(...$renderedContent);
- requestAnimationFrame(onReady);
- });
+ }
+
+ load().then(() => requestAnimationFrame(onReady))
}, [ note ]);
return <>