Symbian.org/FeedUpdateBroker.js
changeset 4 cb6368112727
parent 3 9cbe91927e89
child 6 5e0dece09f96
--- a/Symbian.org/FeedUpdateBroker.js	Tue Jun 09 13:59:04 2009 +0100
+++ b/Symbian.org/FeedUpdateBroker.js	Thu Jun 11 12:40:18 2009 +0100
@@ -166,7 +166,7 @@
             if (buf != "") {
                 buf += " ";
             }
-            buf += child.nodeValue;
+            buf += escapeLtGt(child.nodeValue);
         }
         child = child.nextSibling;
     }
@@ -175,7 +175,8 @@
     var strippedBuf = "";
     var textStartPos = -1;
     var tagBalance = 0;
-    
+	
+    var pos;
     // iterate through the text and append all text to the stripped buffer
     // that is at a tag balance of 0
     for (pos = 0; pos < buf.length; pos++) {
@@ -210,3 +211,9 @@
 	this.cancelled = true;
 	this.httpReq.abort();
 }
+
+function escapeLtGt(text){
+	var lt = "&lt;";
+	var gt = "&gt;";
+	return text.replace(/</g, lt).replace(/>/g, gt);
+}