You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-06-12 22:57:38 +02:00
Better error handling for Katex and handling of code blocks and inline
This commit is contained in:
@ -251,7 +251,11 @@ class MdToHtml {
|
||||
}
|
||||
}
|
||||
|
||||
if (codeBlockHandler) codeBlockHandler.loadAssets();
|
||||
if (codeBlockHandler) {
|
||||
codeBlockHandler.loadAssets().catch((error) => {
|
||||
console.warn('MdToHtml: Error loading assets for ' + codeBlockHandler.name() + ': ', error.message);
|
||||
});
|
||||
}
|
||||
|
||||
if (t.type === 'image') {
|
||||
if (tokenContent) attrs.push(['title', tokenContent]);
|
||||
@ -267,7 +271,7 @@ class MdToHtml {
|
||||
} else {
|
||||
if (tokenContent) {
|
||||
if ((isCodeBlock || isInlineCode) && codeBlockHandler) {
|
||||
output = codeBlockHandler.processContent(output, tokenContent);
|
||||
output = codeBlockHandler.processContent(output, tokenContent, isCodeBlock ? 'block' : 'inline');
|
||||
} else {
|
||||
output.push(htmlentities(tokenContent));
|
||||
}
|
||||
|
Reference in New Issue
Block a user