Fix newline for denied (#22)
This was originally fixed for approved in #12 but the denied case was missing. This adds a failing test and the fix for it.
This commit is contained in:
parent
6b85d8fb55
commit
14ea447010
2 changed files with 6 additions and 1 deletions
|
|
@ -147,7 +147,7 @@ func isApproved(commentBody string) (bool, error) {
|
|||
|
||||
func isDenied(commentBody string) (bool, error) {
|
||||
for _, deniedWord := range deniedWords {
|
||||
matched, err := regexp.MatchString(fmt.Sprintf("(?i)^%s[.!]?$", deniedWord), commentBody)
|
||||
matched, err := regexp.MatchString(fmt.Sprintf("(?i)^%s[.!]*\n*$", deniedWord), commentBody)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue