Skip to content

Commit

Permalink
Replace the note about query-only parsers
Browse files Browse the repository at this point in the history
Parsing just a query requires additional steps.

Current text suggests a parser created with `Parser.query` ignores the path, but it doesn't, and it trips people up: see elm#36 and elm#17.
  • Loading branch information
ktosiek authored Sep 23, 2023
1 parent 4e5ee03 commit 604828f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Url/Parser.elm
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,7 @@ those into normal parsers.
-- s "blog" <?> Query.string "search"
-- s "blog" </> query (Query.string "search")
This may be handy if you need query parameters but are not parsing any path
segments.
**Note:** parsers created with just `query` and no path segments expect an empty path.
-}
query : Query.Parser query -> Parser (query -> a) a
query (Q.Parser queryParser) =
Expand Down

0 comments on commit 604828f

Please sign in to comment.