-                    if(text.length > 13)
-                        text = text.substr(0,13) + '...';
-                    children.push({repr: '"' + text + '"', bold: child.sameNode(textElement)});
+                    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)});