2
0
mirror of https://github.com/Ionaru/easy-markdown-editor synced 2025-07-24 10:24:29 -06:00

Avoid processing many times the same image

Cache img key during processing to avoid having to process it
thousands of times
This commit is contained in:
S1m 2024-06-04 11:36:12 +02:00
parent f039bae67f
commit 97bf9ce8fd

View File

@ -2267,6 +2267,7 @@ EasyMDE.prototype.render = function (el) {
}
if (!window.EMDEimagesCache[keySrc]) {
window.EMDEimagesCache[keySrc] = {};
var img = document.createElement('img');
img.onload = function () {
window.EMDEimagesCache[keySrc] = {