- var node = new wlxmlNode.Node($(selection.anchorNode).parent());\r
- var newNode = this.canvas.insertNode({place: 'wrapText', context: node, tag: wlxmlTag, klass: wlxmlClass, offsetStart: offsetStart, offsetEnd: offsetEnd});\r
- this.selectNode(new wlxmlNode.Node(newNode), {movecaret: 'end'});\r
+ var wrapper = canvasNode.create({tag: wlxmlTag, klass: wlxmlClass});\r
+ this.canvas.nodeWrap({inside: canvasNode.create($(selection.anchorNode).parent()),\r
+ _with: wrapper,\r
+ offsetStart: offsetStart,\r
+ offsetEnd: offsetEnd\r
+ });\r
+ this.selectNode(wrapper, {movecaret: 'end'});\r