Permalink
Browse files

remove trimming from isUrl

  • Loading branch information...
1 parent fd549f0 commit c808c6a165b5fed117afe22ba0372e288bf6d5ab @niklasb committed Jan 20, 2012
Showing with 2 additions and 6 deletions.
  1. +2 −0 lib/completion.js
  2. +0 −6 lib/utils.js
View
2 lib/completion.js
@@ -197,6 +197,8 @@ var completion = (function() {
var url;
var str;
+ // trim query
+ query = query.replace(/^\s+|\s+$/g, '');
if (utils.isUrl(query)) {
url = utils.createFullUrl(query);
str = '<em>goto</em> ' + url;
View
6 lib/utils.js
@@ -56,12 +56,6 @@ var utils = {
// are there more?
var specialHostNames = [ 'localhost' ];
- // trim str
- str = str.replace(/^\s+|\s+$/g, '');
-
- if (str[0] === '/')
- return "file://" + str;
-
// it starts with a scheme, so it's definitely an URL
if (/^[a-z]{3,}:\/\//.test(str))
return true;

0 comments on commit c808c6a

Please sign in to comment.