Minor change to gophermap rendering to get rid of terminal period from server
This commit is contained in:
parent
09dc779045
commit
3a173d89e0
|
@ -39,6 +39,11 @@ func (v *View) ParseMap() {
|
||||||
if v.Address.Gophertype == "1" || v.Address.Gophertype == "7" {
|
if v.Address.Gophertype == "1" || v.Address.Gophertype == "7" {
|
||||||
for i, e := range v.Content {
|
for i, e := range v.Content {
|
||||||
e = strings.Trim(e, "\r\n")
|
e = strings.Trim(e, "\r\n")
|
||||||
|
if e == "." {
|
||||||
|
v.Content[i] = " "
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
line := strings.Split(e,"\t")
|
line := strings.Split(e,"\t")
|
||||||
var title string
|
var title string
|
||||||
if len(line[0]) > 1 {
|
if len(line[0]) > 1 {
|
||||||
|
@ -54,9 +59,8 @@ func (v *View) ParseMap() {
|
||||||
v.Links = append(v.Links, fulllink)
|
v.Links = append(v.Links, fulllink)
|
||||||
linktext := fmt.Sprintf("(%s) %2d %s", GetType(string(line[0][0])), len(v.Links), title)
|
linktext := fmt.Sprintf("(%s) %2d %s", GetType(string(line[0][0])), len(v.Links), title)
|
||||||
v.Content[i] = linktext
|
v.Content[i] = linktext
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
v.Content = v.Content[: len(v.Content) - 1]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue