Skip to content

Commit

Permalink
Merge pull request #301 from atc0005/fix-url-pattern-match-using-index
Browse files Browse the repository at this point in the history
Fix GetURLPatternsUsingIndex URL end pos matching
  • Loading branch information
atc0005 authored Apr 9, 2024
2 parents 5f3a61f + a40455f commit 689176f
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions internal/safelinks/prototyping.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,17 +132,7 @@ func GetURLPatternsUsingIndex(input string) ([]FoundURLPattern, error) {
break
}

// Assume we found ending point until proven otherwise.
// urlEnd := next

// for _, char := range remaining[next:] {
// if unicode.IsSpace(char) {
// break // we found end of URL pattern
// }
// urlEnd++
// }

urlEnd := getURLIndexEndPosition(remaining[next:], next)
urlEnd := getURLIndexEndPosition(remaining, next)

urlPatterns = append(
urlPatterns,
Expand Down

0 comments on commit 689176f

Please sign in to comment.