1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-30 23:44:55 +02:00

Removed cache package dependency and implemented one more suitable for React Native

This commit is contained in:
Laurent Cozic
2020-10-15 18:40:13 +01:00
parent efa346fea4
commit eec32cf70a
18 changed files with 172 additions and 40 deletions

View File

@ -16,7 +16,7 @@ function installRule(markdownIt:any, mdOptions:any, ruleOptions:any, context:any
}
const cacheKey = md5(escape(token.content));
let sanitizedContent = context.cache.get(cacheKey);
let sanitizedContent = context.cache.value(cacheKey);
// For html_inline, the content is only a fragment of HTML, as it will be rendered, but
// it's not necessarily valid HTML. For example this HTML:
@ -37,7 +37,7 @@ function installRule(markdownIt:any, mdOptions:any, ruleOptions:any, context:any
token.content = sanitizedContent;
context.cache.put(cacheKey, sanitizedContent, 1000 * 60 * 60);
context.cache.setValue(cacheKey, sanitizedContent, 1000 * 60 * 60);
walkHtmlTokens(token.children);
}
};