remove leading/trailing white-space before evaluating input's likeliness
authorDamyan Ivanov <dmn@debian.org>
Wed, 22 Aug 2018 13:33:45 +0000 (13:33 +0000)
committerDamyan Ivanov <dmn@debian.org>
Wed, 22 Aug 2018 13:33:45 +0000 (13:33 +0000)
icedeb.js

index b9e8460..0d6676b 100644 (file)
--- a/icedeb.js
+++ b/icedeb.js
@@ -180,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');