fix title matching to extract subgroup

master
nate smith 2019-09-09 13:22:41 -05:00
parent 2a4fef7566
commit ee807dcac8
1 changed files with 5 additions and 3 deletions

View File

@ -85,9 +85,11 @@ func pageTitleFor(username string) string {
fmt.Fprintf(os.Stderr, "failed to read %q: %v\n", indexPath, err) fmt.Fprintf(os.Stderr, "failed to read %q: %v\n", indexPath, err)
return "" return ""
} }
title := pageTitleRe.FindString(string(content)) titleMatch := pageTitleRe.FindStringSubmatch(string(content))
if len(titleMatch) < 2 {
return title return ""
}
return titleMatch[1]
} }
func systemUsers() map[string]bool { func systemUsers() map[string]bool {