New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support search engine escaping of spaces (+) #215
Conversation
@garbas Feel free to check last commit 95de1b7 but also be aware of the limitations |
95de1b7
to
0ef840e
Compare
This now works when we load the app with the url that has |
yes exactly. Anyway I'm afraid there is no way around the 2nd problem because even with |
I guess we will have to resort to ports and implement our own wrapper around |
I would first like to check where does the escaping happens. If it's in Browser.Navigation or within Url.Parser. If it's the later there would also be option to "patch this on just a parser level" by accessing the raw string. The only kernel function of Url parser seems to be binding to decode/encodeURIComponent. https://github.com/elm/url/blob/master/src/Elm/Kernel/Url. If we'll be able to get undecoded data from navigation object in elm we might consider either:
I'll let you know once I know more. |
@garbas See the last commit - it implements pure elm solution. In theory it would be possible to just wrap whole elm/url |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great. And I like the solution.
resolves #200
Interpret
+
in seaerch query string as space.There is a limitation imposed by elm URL parser we can't access get the raw urls string even when usingUrl.Parser.Query.custom
-- the string argument is already decoded. this means we can't tell if the+
comes from url or was decoded from percent string (%2B
). All+
are replaced with space.Showcase
previous PR: #214