X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/59b807cd7a781fad54e66f1e59b09369d91d53b4..06ff71dcb6c913a66280ebf812481224ee461f8c:/src/smartxml/smartxml.js diff --git a/src/smartxml/smartxml.js b/src/smartxml/smartxml.js index e484070..05583c5 100644 --- a/src/smartxml/smartxml.js +++ b/src/smartxml/smartxml.js @@ -91,13 +91,12 @@ $.extend(DocumentNode.prototype, { }), wrapWith: function(node) { - node = node instanceof ElementNode ? node : this.document.createElementNode(node); - + var insertion = this.getNodeInsertion(node); if(this.parent()) { - this.before(node); + this.before(insertion.ofNode); } - node.append(this); - return node; + insertion.ofNode.append(this); + return insertion.ofNode; }, /**