Update hosts.js

This commit is contained in:
Namhyeon Go 2020-07-29 15:38:55 +09:00
parent 7556c0cce4
commit 9d1e7d202e

View File

@ -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++) {