From 2e56014376cdf6998d2dd76e07fe05c1f6a12574 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Wed, 11 Dec 2013 13:15:44 +0100 Subject: [PATCH] wlxml: Use smartxml hook for XML normalization --- src/wlxml/wlxml.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/wlxml/wlxml.js b/src/wlxml/wlxml.js index b3783af..a320da3 100644 --- a/src/wlxml/wlxml.js +++ b/src/wlxml/wlxml.js @@ -161,7 +161,11 @@ $.extend(WLXMLDocument.prototype, { ElementNodeFactory: WLXMLElementNode, loadXML: function(xml) { smartxml.Document.prototype.loadXML.call(this, xml, {silent: true}); - $(this.dom).find(':not(iframe)').addBack().contents() + this.trigger('contentSet'); + }, + + normalizeXML: function(nativeNode) { + $(nativeNode).find(':not(iframe)').addBack().contents() .filter(function() {return this.nodeType === Node.TEXT_NODE;}) .each(function() { var el = $(this), @@ -243,7 +247,6 @@ $.extend(WLXMLDocument.prototype, { /* globals document */ el.replaceWith(document.createTextNode(text.transformed)); }); - this.trigger('contentSet'); }, registerClassTransformation: function(Transformation, className) { -- 2.20.1