forked from alfred/HostPersister
Fix tab support.
This commit is contained in:
parent
002ec28d30
commit
2d7f061aa1
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
@ -3,7 +3,7 @@ package hosts
|
||||
import "strings"
|
||||
|
||||
func NewHostsEntry(lineIn string) Entry {
|
||||
trLineIn := strings.Trim(lineIn, "\r\n")
|
||||
trLineIn := strings.ReplaceAll(strings.Trim(lineIn, "\r\n"), " ", " ")
|
||||
lineSplt := strings.Split(trLineIn, " ")
|
||||
if len(lineSplt) == 1 && strings.HasPrefix(trLineIn, "#") {
|
||||
return Entry{
|
||||
@ -14,6 +14,9 @@ func NewHostsEntry(lineIn string) Entry {
|
||||
} else if len(lineSplt) > 1 {
|
||||
var theDomains []string
|
||||
for i := 1; i < len(lineSplt); i++ {
|
||||
if lineSplt[i] == "" {
|
||||
continue
|
||||
}
|
||||
if strings.HasPrefix(lineSplt[i], "#") {
|
||||
break
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user