Update title.go

Make regexp for the title tag case-insensitive
This commit is contained in:
Corben Leo 2020-07-21 16:24:58 -05:00 committed by GitHub
parent 6afdaf5c56
commit e4fc712efc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,7 +9,7 @@ import (
// ExtractTitle from a response
func ExtractTitle(r *Response) string {
var re = regexp.MustCompile(`(?m)<\s*title *>(.*?)<\s*/\s*title>`)
var re = regexp.MustCompile(`(?im)<\s*title *>(.*?)<\s*/\s*title>`)
for _, match := range re.FindAllString(r.Raw, -1) {
return html.UnescapeString(trimTitleTags(match))
}