community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject svn commit: r1782935 - /comdev/projects.apache.org/site/js/projects.js
Date Tue, 14 Feb 2017 09:24:57 GMT
Author: humbedooh
Date: Tue Feb 14 09:24:56 2017
New Revision: 1782935

URL: http://svn.apache.org/viewvc?rev=1782935&view=rev
Log:
ditch escaping, construct a text node instead

Modified:
    comdev/projects.apache.org/site/js/projects.js

Modified: comdev/projects.apache.org/site/js/projects.js
URL: http://svn.apache.org/viewvc/comdev/projects.apache.org/site/js/projects.js?rev=1782935&r1=1782934&r2=1782935&view=diff
==============================================================================
--- comdev/projects.apache.org/site/js/projects.js (original)
+++ comdev/projects.apache.org/site/js/projects.js Tue Feb 14 09:24:56 2017
@@ -1517,7 +1517,11 @@ function searchProjects(str) {
         }
     }
 
-    obj.innerHTML = "<h2>Search results for '" + str.replace(/</g, "&lt;").replace(/>/g,
"&gt;") + "' (" + hitssorted.length + "):</h2>";
+    var title = "Search results for '" + str + "' (" + hitssorted.length + "):";
+    obj.innerHTML = "";
+    var h2 = document.createElement('h2');
+    h2.appendChild(document.createTextNode(title));
+    obj.appendChild(h2);
     hitssorted.sort(function(a,b) { return hits[b].length - hits[a].length });
     var ul = document.createElement('ul');
 



Mime
View raw message