From: Aleksander Ɓukasz Date: Thu, 18 Apr 2013 12:44:03 +0000 (+0200) Subject: Visual editor fix: class attr was lost during translation to xml X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/73894afa5c6ed0829890f129def7e85540e3366c Visual editor fix: class attr was lost during translation to xml --- diff --git a/modules/visualEditor.transformations.js b/modules/visualEditor.transformations.js index 49f9aa3..2edf3d0 100644 --- a/modules/visualEditor.transformations.js +++ b/modules/visualEditor.transformations.js @@ -69,7 +69,11 @@ if(typeof module !== 'undefined' && module.exports) { toret.find('div, span').replaceWith(function() { var div = $(this); var tagName = div.attr('wlxml-tag'); - return $('<'+tagName+'>').append(div.contents()); + var toret = $('<'+tagName+'>'); + if(div.attr('wlxml-class')) + toret.attr('class', div.attr('wlxml-class')) + toret.append(div.contents()); + return toret; }); var meta = $('');