- var children = [];
- node.children().each(function() {
- var child = this;
- children.push({repr: child.getTag() + (child.getClass() ? ' / ' + child.getClass() : ''), id: child.getId()});
- nodes[child.getId()] = child;
+ var nodeChildren = nodeElement.children(),
+ children = [];
+ nodeChildren.forEach(function(child) {
+ if(child.getText) {
+ var text = child.getText();
+ if(!text)
+ text = '<pusty tekst>';
+ else {
+ if(text.length > 13) {
+ text = text.substr(0,13) + '...';
+ }
+ text = '"' + text + '"';
+ }
+ children.push({repr: _.escape(text), bold: child.sameNode(textElement)});
+ } else {
+ children.push({repr: wlxmlUtils.wlxmlTagNames[child.getWlxmlTag()] + (child.getWlxmlClass() ? ' / ' + wlxmlUtils.wlxmlClassNames[child.getWlxmlClass()] : '')});
+ }