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 {
|
return {
|
||||||
execute: async (_context: CommandContext, markupLanguage: MarkupLanguage, markup: string, _rendererOptions: Options = null, renderOptions: RenderOptions = null) => {
|
execute: async (_context: CommandContext, markupLanguage: MarkupLanguage, markup: string, _rendererOptions: Options = null, renderOptions: RenderOptions = null) => {
|
||||||
const markupToHtml = getMarkupToHtml();
|
const markupToHtml = getMarkupToHtml();
|
||||||
const html = await markupToHtml.render(markupLanguage, markup, themeStyle(Setting.value('theme')), {
|
|
||||||
...renderOptions,
|
try {
|
||||||
resources: await attachedResources(markup),
|
const html = await markupToHtml.render(markupLanguage, markup, themeStyle(Setting.value('theme')), {
|
||||||
splitted: true,
|
...renderOptions,
|
||||||
});
|
resources: await attachedResources(markup),
|
||||||
return html;
|
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