From 73894afa5c6ed0829890f129def7e85540e3366c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Thu, 18 Apr 2013 14:44:03 +0200 Subject: [PATCH] Visual editor fix: class attr was lost during translation to xml --- modules/visualEditor.transformations.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 = $(''); -- 2.20.1