Skip to content

Instantly share code, notes, and snippets.

@JonCatmull
Created August 26, 2015 08:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JonCatmull/ec8eb9488955f2be3163 to your computer and use it in GitHub Desktop.
Save JonCatmull/ec8eb9488955f2be3163 to your computer and use it in GitHub Desktop.
Fix for redactor in chrome
// Place inside setEvents: function() { on line 1361
// Check for chrome span bug
this.$editor.on("DOMNodeInserted", $.proxy(function(e) {
if (e.target.tagName == "SPAN" ) {
console.log('clean spans');
var helper = $("<b>helper</b>");
$(e.target).before(helper);
helper.after($(e.target).contents());
helper.remove();
$(e.target).remove();
}
}, this));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment