feat(content_renderer): render docnotes

This commit is contained in:
Elian Doran 2025-03-11 21:57:33 +02:00
parent 32f84e8378
commit 3457c2e4d8
No known key found for this signature in database

View File

@ -13,6 +13,7 @@ import imageContextMenuService from "../menus/image_context_menu.js";
import { applySingleBlockSyntaxHighlight, applySyntaxHighlight } from "./syntax_highlight.js";
import { loadElkIfNeeded, postprocessMermaidSvg } from "./mermaid.js";
import { normalizeMimeTypeForCKEditor } from "./mime_type_definitions.js";
import renderDoc from "./doc_renderer.js";
let idCounter = 1;
@ -54,6 +55,9 @@ async function getRenderedContent(this: {} | { ctx: string }, entity: FNote | FA
await renderService.render(entity, $content);
$renderedContent.append($content);
} else if (type === "doc" && "noteId" in entity) {
const $content = await renderDoc(entity);
$renderedContent.html($content.html());
} else if (!options.tooltip && type === "protectedSession") {
const $button = $(`<button class="btn btn-sm"><span class="bx bx-log-in"></span> Enter protected session</button>`).on("click", protectedSessionService.enterProtectedSession);