From 1261bdbb2999ce2346f1f176b76728124180f853 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Thu, 7 Nov 2024 23:58:10 +0200 Subject: [PATCH] client: Use correct background for code note preview --- src/public/app/services/content_renderer.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/public/app/services/content_renderer.js b/src/public/app/services/content_renderer.js index 3593662829..a19c47e5b5 100644 --- a/src/public/app/services/content_renderer.js +++ b/src/public/app/services/content_renderer.js @@ -122,10 +122,10 @@ async function renderText(note, $renderedContent) { async function renderCode(note, $renderedContent) { const blob = await note.getBlob(); - const $codeBlock = $("
"); 
+    const $codeBlock = $("");
     $codeBlock.text(blob.content);
-    applySingleBlockSyntaxHighlight($codeBlock, mime_types.normalizeMimeTypeForCKEditor(note.mime));
-    $renderedContent.append($codeBlock);
+    $renderedContent.append($("
").append($codeBlock));
+    await applySingleBlockSyntaxHighlight($codeBlock, mime_types.normalizeMimeTypeForCKEditor(note.mime));
 }
 
 function renderImage(entity, $renderedContent, options = {}) {