]> git.ktnx.net Git - icedeb.git/blobdiff - icedeb.js
remove leading/trailing white-space before evaluating input's likeliness
[icedeb.git] / icedeb.js
index e6525400eb2eb65a9d31e8e522166213726719b5..0d6676b5e4e9d49581548b22975e7da491adf9b9 100644 (file)
--- a/icedeb.js
+++ b/icedeb.js
@@ -30,6 +30,7 @@ function trim(word) {
     word = word.replace(/^[^a-zA-Z0-9]+/, '');
     word = word.replace(/[^a-zA-Z0-9]+$/, '');
     word = word.replace(/^Bug#/i, '');
+    word = word.replace(/^#/, '');
   } while ( oldword != word );
 
   return word;
@@ -179,6 +180,9 @@ function check_likely_inputs(q) {
         el.classList.remove('likely');
     });
 
+  q = q.replace(/^\s+/, '');
+  q = q.replace(/\s+$/, '');
+
   if ( /^#?\d+$/.test(q) || /^CVE-/.test(q) )
     cnt.add('like-b');