Move "(no title)" text to its own constant noTitleStr.
Main purpose is for making integration testing easier later.develop
parent
ec899f0ddf
commit
8696313f8e
|
@ -28,6 +28,7 @@ var (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
noTitleStr = "(no title)"
|
||||||
maxHtmlSize = 8 * 1024
|
maxHtmlSize = 8 * 1024
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -111,7 +112,7 @@ func (p *Parser) Parse(u *url.URL, referer *url.URL) (result parsers.ParseResult
|
||||||
result.Information[0]["Title"] = rxNewlines.ReplaceAllString(scrape.Text(title), " ")
|
result.Information[0]["Title"] = rxNewlines.ReplaceAllString(scrape.Text(title), " ")
|
||||||
} else {
|
} else {
|
||||||
// No title found
|
// No title found
|
||||||
result.Information[0]["Title"] = "(no title)"
|
result.Information[0]["Title"] = noTitleStr
|
||||||
}
|
}
|
||||||
case "image/png", "image/jpeg", "image/gif":
|
case "image/png", "image/jpeg", "image/gif":
|
||||||
log.Print("Parsing image...")
|
log.Print("Parsing image...")
|
||||||
|
|
Loading…
Reference in New Issue