From 00209ec77a3a1b755f45eeef88b0620486c98067 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Thu, 31 Oct 2024 22:18:00 +0200 Subject: [PATCH] client: Apply syntax highlight to included notes --- src/public/app/services/content_renderer.js | 3 +++ src/public/app/services/note_list_renderer.js | 5 +---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/public/app/services/content_renderer.js b/src/public/app/services/content_renderer.js index 9d7285503..8d7f5ce55 100644 --- a/src/public/app/services/content_renderer.js +++ b/src/public/app/services/content_renderer.js @@ -10,6 +10,7 @@ import treeService from "./tree.js"; import FNote from "../entities/fnote.js"; import FAttachment from "../entities/fattachment.js"; import imageContextMenuService from "../menus/image_context_menu.js"; +import { applySyntaxHighlight } from "./syntax_highlight.js"; let idCounter = 1; @@ -105,6 +106,8 @@ async function renderText(note, $renderedContent) { for (const el of referenceLinks) { await linkService.loadReferenceLinkTitle($(el)); } + + applySyntaxHighlight($renderedContent); } else { await renderChildrenList($renderedContent, note); } diff --git a/src/public/app/services/note_list_renderer.js b/src/public/app/services/note_list_renderer.js index 8394d350f..fb6e2981b 100644 --- a/src/public/app/services/note_list_renderer.js +++ b/src/public/app/services/note_list_renderer.js @@ -5,7 +5,6 @@ import attributeRenderer from "./attribute_renderer.js"; import libraryLoader from "./library_loader.js"; import treeService from "./tree.js"; import utils from "./utils.js"; -import { applySyntaxHighlight } from "./syntax_highlight.js"; const TPL = `
@@ -367,9 +366,7 @@ class NoteListRenderer { separateWordSearch: false, caseSensitive: false }); - } - - applySyntaxHighlight($renderedContent); + } $content.append($renderedContent); $content.addClass(`type-${type}`);