Skip to content

Commit

Permalink
Fix GetURLPatternsUsingIndex URL end pos matching
Browse files Browse the repository at this point in the history
Previous refactoring for 0b8ac0a
incorrectly passed the same slice into the helper function that
it needed to initially calculate on its own.

However, since GetURLPatternsUsingIndex was not called by
the `dsl` tool it was unaffected by this issue.

refs GH-210
refs GH-185
  • Loading branch information
atc0005 committed Mar 28, 2024
1 parent ac98c9f commit a9bbbea
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 @@ -128,17 +128,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 a9bbbea

Please sign in to comment.