Skip to content

Commit

Permalink
localhost is direct URL now instead of geminispace.info/search?localh…
Browse files Browse the repository at this point in the history
…ost (#326) (#327)
  • Loading branch information
FiskFan1999 committed May 20, 2023
1 parent e432e28 commit 40f55d8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions display/display.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,10 @@ func Init(version, commit, builtBy string) {
// We don't want to convert legitimate
// :// links to search terms.
query := strings.TrimSpace(query)
if (strings.Contains(query, " ") && !hasSpaceisURL.MatchString(query)) ||
if ((strings.Contains(query, " ") && !hasSpaceisURL.MatchString(query)) ||
(!strings.HasPrefix(query, "//") && !strings.Contains(query, "://") &&
!strings.Contains(query, ".")) && !strings.HasPrefix(query, "about:") {
!strings.Contains(query, ".")) && !strings.HasPrefix(query, "about:")) &&
!(query == "localhost" || strings.HasPrefix(query, "localhost/") || strings.HasPrefix(query, "localhost:")) {
// Has a space and follows regex, OR
// doesn't start with "//", contain "://", and doesn't have a dot either.
// Then it's a search
Expand Down

0 comments on commit 40f55d8

Please sign in to comment.