should be ok and may be useful to save our own images

This commit is contained in:
Ted Unangst 2019-10-22 00:21:21 -04:00
parent 054aa15a17
commit 1bd7069515

2
fun.go
View file

@ -170,12 +170,10 @@ func inlineimgsfor(honk *Honk) func(node *html.Node) string {
return func(node *html.Node) string { return func(node *html.Node) string {
src := htfilter.GetAttr(node, "src") src := htfilter.GetAttr(node, "src")
alt := htfilter.GetAttr(node, "alt") alt := htfilter.GetAttr(node, "alt")
if !strings.HasPrefix(src, "https://"+serverName+"/") {
d := savedonk(src, "image", alt, "image", true) d := savedonk(src, "image", alt, "image", true)
if d != nil { if d != nil {
honk.Donks = append(honk.Donks, d) honk.Donks = append(honk.Donks, d)
} }
}
log.Printf("inline img with src: %s", src) log.Printf("inline img with src: %s", src)
return "" return ""
} }