mirror of
https://github.com/zadam/trilium.git
synced 2026-02-22 21:54:39 +01:00
feat(content_renderer): display render errors
This commit is contained in:
parent
fcc740d592
commit
bf302a84a9
@ -15,7 +15,7 @@ import protectedSessionService from "./protected_session.js";
|
||||
import protectedSessionHolder from "./protected_session_holder.js";
|
||||
import renderService from "./render.js";
|
||||
import { applySingleBlockSyntaxHighlight } from "./syntax_highlight.js";
|
||||
import utils from "./utils.js";
|
||||
import utils, { getErrorMessage } from "./utils.js";
|
||||
|
||||
let idCounter = 1;
|
||||
|
||||
@ -62,7 +62,10 @@ export async function getRenderedContent(this: {} | { ctx: string }, entity: FNo
|
||||
} else if (type === "render" && entity instanceof FNote) {
|
||||
const $content = $("<div>");
|
||||
|
||||
await renderService.render(entity, $content);
|
||||
await renderService.render(entity, $content, (e) => {
|
||||
const $error = $("<div>").addClass("admonition caution").text(typeof e === "string" ? e : getErrorMessage(e));
|
||||
$content.empty().append($error);
|
||||
});
|
||||
|
||||
$renderedContent.append($content);
|
||||
} else if (type === "doc" && "noteId" in entity) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user