1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-26 22:41:17 +02:00

Chore: Improve error message when renderMarkup command cannot render some text

This commit is contained in:
Laurent Cozic
2025-02-24 16:53:41 +00:00
parent d0e16c0878
commit 3caa718132

View File

@@ -22,12 +22,18 @@ export const runtime = (): CommandRuntime => {
return {
execute: async (_context: CommandContext, markupLanguage: MarkupLanguage, markup: string, _rendererOptions: Options = null, renderOptions: RenderOptions = null) => {
const markupToHtml = getMarkupToHtml();
try {
const html = await markupToHtml.render(markupLanguage, markup, themeStyle(Setting.value('theme')), {
...renderOptions,
resources: await attachedResources(markup),
splitted: true,
});
return html;
} catch (error) {
error.message = `Could not render markup: markupLanguage: ${markupLanguage} Markup: ${markup}: ${error.message}`;
throw error;
}
},
};
};