Skip to content

Commit

Permalink
Avoid processing many times the same image
Browse files Browse the repository at this point in the history
Cache img key during processing to avoid having to process it
thousands of times
  • Loading branch information
p1gp1g committed Jun 4, 2024
1 parent f039bae commit 97bf9ce
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/js/easymde.js
Original file line number Diff line number Diff line change
Expand Up @@ -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] = {
Expand Down

0 comments on commit 97bf9ce

Please sign in to comment.