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

chore: adjust regex from previewing images to only try to render if image has bracket before of parentheses

This commit is contained in:
Mayra Amaral 2025-02-11 16:05:13 -03:00
parent a6b121f2e6
commit 138c198852

View File

@ -2251,7 +2251,7 @@ EasyMDE.prototype.render = function (el) {
return; return;
} }
if (!parentEl.hasAttribute('data-img-src')) { if (!parentEl.hasAttribute('data-img-src')) {
var srcAttr = parentEl.innerText.match('\\((.*)\\)'); // might require better parsing according to markdown spec var srcAttr = parentEl.innerText.match(/!\[.*?\]\((.*?)\)/); // might require better parsing according to markdown spec
if (!window.EMDEimagesCache) { if (!window.EMDEimagesCache) {
window.EMDEimagesCache = {}; window.EMDEimagesCache = {};
} }