From 508aab0bd555b4ca7632a78957ebb91c758f0a7e Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 14 Nov 2017 22:05:47 -0800 Subject: Text.Pandoc.Parsing.uri: allow `&` and `=` as word characters. This fixes a bug where pandoc would stop parsing a URI with an empty attribute: for example, `&a=&b=` wolud stop at `a`. (The uri parser tries to guess which punctuation characters are part of the URI and which might be punctuation after it.) Closes #4068. --- src/Text/Pandoc/Parsing.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Text/Pandoc') diff --git a/src/Text/Pandoc/Parsing.hs b/src/Text/Pandoc/Parsing.hs index 61d3caf3d..d8418ed11 100644 --- a/src/Text/Pandoc/Parsing.hs +++ b/src/Text/Pandoc/Parsing.hs @@ -563,7 +563,7 @@ uri = try $ do -- http://en.wikipedia.org/wiki/State_of_emergency_(disambiguation) -- as a URL, while NOT picking up the closing paren in -- (http://wikipedia.org). So we include balanced parens in the URL. - let isWordChar c = isAlphaNum c || c `elem` "#$%*+/@\\_-" + let isWordChar c = isAlphaNum c || c `elem` "#$%*+/@\\_-&=" let wordChar = satisfy isWordChar let percentEscaped = try $ char '%' >> skipMany1 (satisfy isHexDigit) let entity = () <$ characterReference -- cgit v1.2.3