Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Commit 95052e3

Browse files
committed
Merge pull request #114 from j0k3r/fix-98
Do not remove plugin on cleaning empty placeholder
2 parents 0ca2a44 + 1668a22 commit 95052e3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/js/medium-editor-insert-plugin.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,13 @@
334334
// by removing all empty placeholders
335335
if (that.isFirefox){
336336
$('.mediumInsert .mediumInsert-placeholder:empty', $el).each(function () {
337-
$(this).parent().remove();
337+
var parent = $(this).parent();
338+
339+
// if the parent has at least one div child it means it can be a plugin, so we don't remove it
340+
// for example, embed works like that (Fix #98)
341+
if (0 === parent.find('.mediumInsert-buttons div').length) {
342+
parent.remove();
343+
}
338344
});
339345
}
340346

0 commit comments

Comments
 (0)