Move "(no title)" text to its own constant noTitleStr.

Main purpose is for making integration testing easier later.
develop
Icedream 2016-06-19 23:32:27 +02:00
parent ec899f0ddf
commit 8696313f8e
1 changed files with 2 additions and 1 deletions

View File

@ -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...")