1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Desktop: Resolves #7867: Cache code blocks in notes to speed up rendering

This commit is contained in:
Laurent Cozic 2023-03-07 17:51:29 +00:00
parent 235288e903
commit 57f00c612d
2 changed files with 2 additions and 1 deletions

View File

@ -62,6 +62,7 @@ export default function useMarkupToHtml(deps: HookDependencies) {
postMessageSyntax: 'ipcProxySendToHost', postMessageSyntax: 'ipcProxySendToHost',
splitted: true, splitted: true,
externalAssetsOnly: true, externalAssetsOnly: true,
codeHighlightCacheKey: 'useMarkupToHtml',
}, options)); }, options));
return result; return result;

View File

@ -494,7 +494,7 @@ export default class MdToHtml {
const cacheKey = md5(`${str}_${lang}`); const cacheKey = md5(`${str}_${lang}`);
if (options.codeHighlightCacheKey && this.cachedHighlightedCode_[cacheKey]) { if (options.codeHighlightCacheKey && cacheKey in this.cachedHighlightedCode_) {
hlCode = this.cachedHighlightedCode_[cacheKey]; hlCode = this.cachedHighlightedCode_[cacheKey];
} else { } else {
if (lang && hljs.getLanguage(lang)) { if (lang && hljs.getLanguage(lang)) {