Visual editor fix: class attr was lost during translation to xml
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Thu, 18 Apr 2013 12:44:03 +0000 (14:44 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Thu, 18 Apr 2013 12:44:03 +0000 (14:44 +0200)
modules/visualEditor.transformations.js

index 49f9aa3..2edf3d0 100644 (file)
@@ -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 = $('<metadata>');