Skip to content

Commit

Permalink
Merge pull request #36 from unisoncomputing/guard-against-browser-spaces
Browse files Browse the repository at this point in the history
Guard against how Browsers encode spaces
  • Loading branch information
hojberg authored Dec 5, 2024
2 parents d1bf17e + e9956d6 commit 770d842
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/UnisonShare/App.elm
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ init appContext route =
search =
Parser.parse (Parser.query (Query.string "search")) url
|> Maybe.withDefault Nothing
-- When using the Browser's address bar to
-- perform a search on Share it uses + instead
-- of %20 to encode spaces and this ends up as
-- literal + when parsed with Url.percentDecode
|> Maybe.map (String.replace "+" "%20")
|> Maybe.andThen Url.percentDecode

filter =
Expand Down

0 comments on commit 770d842

Please sign in to comment.