+
+ var ANNOT_ALLOWED = ['wyroznienie'];
+
+ function html2plainText(fragment) {
+ var text = "";
+
+ $(fragment.childNodes).each(function() {
+ if(this.nodeType == 3) // textNode
+ text += this.nodeValue;
+ else if (this.nodeType == 1
+ && $.inArray($(this).attr('x-node'), ANNOT_ALLOWED) != -1 ){
+ text += html2plainText(this);
+ }
+ });
+
+ return text;
+ }