Skip to content

Commit 138c198

Browse files
committed
chore: adjust regex from previewing images to only try to render if image has bracket before of parentheses
1 parent a6b121f commit 138c198

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/js/easymde.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2251,7 +2251,7 @@ EasyMDE.prototype.render = function (el) {
22512251
return;
22522252
}
22532253
if (!parentEl.hasAttribute('data-img-src')) {
2254-
var srcAttr = parentEl.innerText.match('\\((.*)\\)'); // might require better parsing according to markdown spec
2254+
var srcAttr = parentEl.innerText.match(/!\[.*?\]\((.*?)\)/); // might require better parsing according to markdown spec
22552255
if (!window.EMDEimagesCache) {
22562256
window.EMDEimagesCache = {};
22572257
}

0 commit comments

Comments
 (0)