mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-13 21:21:03 +00:00
Update hosts.js
This commit is contained in:
parent
7556c0cce4
commit
9d1e7d202e
|
@ -14,7 +14,12 @@ exports.getHosts = function() {
|
||||||
var lines = fileContent.split(/[\r\n]+/g).filter(function(s) {
|
var lines = fileContent.split(/[\r\n]+/g).filter(function(s) {
|
||||||
return !(s.indexOf('#') == 0)
|
return !(s.indexOf('#') == 0)
|
||||||
}).map(function(s) {
|
}).map(function(s) {
|
||||||
return s.replace(/\s\s/g, ' ');
|
var pos = s.indexOf('#');
|
||||||
|
if(pos > -1) {
|
||||||
|
return s.substring(pos).replace(/\s\s/g, ' ');
|
||||||
|
} else {
|
||||||
|
return s.replace(/\s\s/g, ' ');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
for (var i = 0; i < lines.length; i++) {
|
for (var i = 0; i < lines.length; i++) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user