diff --git a/cmd/gopherbot/gopherbot.go b/cmd/gopherbot/gopherbot.go index 45ef7349a2..b9000501b7 100644 --- a/cmd/gopherbot/gopherbot.go +++ b/cmd/gopherbot/gopherbot.go @@ -19,6 +19,7 @@ import ( "net/http" "os" "path/filepath" + "regexp" "sort" "strconv" "strings" @@ -1988,8 +1989,11 @@ func isDocumentationTitle(t string) bool { if strings.Contains(t, "godoc:") { // in x/tools, or the dozen places people file it as return false } - return strings.Contains(t, "document") || - strings.Contains(t, "docs ") + if strings.Contains(t, "docs ") { + return true + } + return strings.Contains(t, "document") && + regexp.MustCompile(`\bdocument\b`).MatchString(t) } func isGoplsTitle(t string) bool {