evancz / url-parser

Parse URLs into nicely structured data
http://package.elm-lang.org/packages/evancz/url-parser/latest/
BSD 3-Clause "New" or "Revised" License
114 stars 29 forks source link

parseHash + stringParam not working #20

Closed littleStudent closed 7 years ago

littleStudent commented 7 years ago

I am having problems with parseHash and stringParam together. I checked out the example app and changed the following.

  1. parsePath -> parseHash in line 30 + line 72
  2. changed line 94 to , ul [] (List.map viewLink [ "/#/", "/#/blog/", "/#/blog/42", "/#/blog/37", "/#/blog/?search=cats" ])

The first 3 paths work without any problems. But /#/blog/?search=cats results in "Invalid URL". Am I missing something or is it a bug?

here is the fork with these minimal changes https://github.com/littleStudent/url-parser

ADD: it seems like document.location.search is empty when using Hash. So is there even a way to use query strings?

process-bot commented 7 years ago

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

sporto commented 7 years ago

Should be ?search=cats#/blog/. The query needs to go first.