forked from sloum/bombadillo
Merge branch 'type-seven-bm-fix' of sloum/bombadillo into master
Thanks for all the help @asdf! Merging this into master. This PR closes issue #29
This commit is contained in:
commit
309d6244e1
|
@ -95,7 +95,7 @@ func Visit(addr, openhttp string) (View, error) {
|
||||||
|
|
||||||
return View{}, fmt.Errorf("")
|
return View{}, fmt.Errorf("")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
text, err := Retrieve(u)
|
text, err := Retrieve(u)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -3,6 +3,7 @@ package gopher
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
//------------------------------------------------\\
|
//------------------------------------------------\\
|
||||||
|
@ -76,6 +77,10 @@ func MakeUrl(u string) (Url, error) {
|
||||||
out.Gophertype = "0"
|
out.Gophertype = "0"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if out.Gophertype == "7" && strings.Contains(out.Resource, "\t") {
|
||||||
|
out.Gophertype = "1"
|
||||||
|
}
|
||||||
|
|
||||||
switch out.Gophertype {
|
switch out.Gophertype {
|
||||||
case "1", "0", "h", "7":
|
case "1", "0", "h", "7":
|
||||||
out.IsBinary = false
|
out.IsBinary = false
|
||||||
|
|
|
@ -46,9 +46,8 @@ func (v *View) ParseMap() {
|
||||||
} else {
|
} else {
|
||||||
title = ""
|
title = ""
|
||||||
}
|
}
|
||||||
if len(line[0]) > 0 && string(line[0][0]) == "i" {
|
if len(line) > 1 && len(line[0]) > 0 && string(line[0][0]) == "i" {
|
||||||
v.Content[i] = " " + string(title)
|
v.Content[i] = " " + string(title)
|
||||||
continue
|
|
||||||
} else if len(line) >= 4 {
|
} else if len(line) >= 4 {
|
||||||
fulllink := fmt.Sprintf("%s:%s/%s%s", line[2], line[3], string(line[0][0]), line[1])
|
fulllink := fmt.Sprintf("%s:%s/%s%s", line[2], line[3], string(line[0][0]), line[1])
|
||||||
v.Links = append(v.Links, fulllink)
|
v.Links = append(v.Links, fulllink)
|
||||||
|
|
Loading…
Reference in New Issue