From 604828f55b75515f54e80f7ebf202bcc87ebece7 Mon Sep 17 00:00:00 2001 From: Tomasz Kontusz Date: Sat, 23 Sep 2023 14:12:57 +0200 Subject: [PATCH] Replace the note about query-only parsers 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 https://github.com/elm/url/issues/36 and https://github.com/elm/url/issues/17. --- src/Url/Parser.elm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Url/Parser.elm b/src/Url/Parser.elm index e3f1ec3..4acec24 100644 --- a/src/Url/Parser.elm +++ b/src/Url/Parser.elm @@ -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) =