You've already forked joplin
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:
@@ -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;
|
||||
}
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user