diff --git a/sites/all/modules/contrib/wysiwyg/plugins/break/break.js b/sites/all/modules/contrib/wysiwyg/plugins/break/break.js index 54aac4c..d90b4a2 100644 --- a/sites/all/modules/contrib/wysiwyg/plugins/break/break.js +++ b/sites/all/modules/contrib/wysiwyg/plugins/break/break.js @@ -46,15 +46,22 @@ Drupal.wysiwyg.plugins['break'] = { * Replace images with tags in content upon detaching editor. */ detach: function(content, settings, instanceId) { - var $content = $('
' + content + '
'); // No .outerHTML() in jQuery :( - // #404532: document.createComment() required or IE will strip the comment. - // #474908: IE 8 breaks when using jQuery methods to replace the elements. - // @todo Add a generic implementation for all Drupal plugins for this. - $.each($('img.wysiwyg-break', $content), function (i, elem) { + //Make a new parser since JQuery's breaks + var parser = new DOMParser(); + var doc = parser.parseFromString(content, "text/html"); + + //Get the images + var breakImages = doc.getElementsByClassName("img.wysiwyg-break"); + + //For every image, do work + for(var i=0; i