Muse reader: allow URL to be empty
Muse writer can write links with empty URLs, so Muse reader should read them.
commit9cc2bf0295a66182223c9ec421a4755d1acebeb1
authorAlexander Krotov <ilabdsf@gmail.com>
dateSun 15 Apr 2018, 14:50 (9 years ago)
parent6be0139
src/Text/Pandoc/Readers/Muse.hs+1−1
@@ -972,7 +972,7 @@ linkContent = char '[' >> trimInlinesF . mconcat <$> manyTill inline (string "]"
972972linkText :: PandocMonad m => MuseParser m (String, Maybe (F Inlines))
973973linkText = do
974974 string "[["
975− url <- many1Till anyChar $ char ']'
975+ url <- manyTill anyChar $ char ']'
976976 content <- optionMaybe linkContent
977977 char ']'
978978 return (url, content)
test/Tests/Readers/Muse.hs+1
@@ -209,6 +209,7 @@ tests =
209209 -- This test also makes sure '=' without whitespace is not treated as code markup
210210 , "No implicit links" =: "http://example.org/index.php?action=view&id=1"
211211 =?> para "http://example.org/index.php?action=view&id=1"
212+ , "Link with empty URL" =: "[[][empty URL]]" =?> para (link "" "" (text "empty URL"))
212213 ]
213214
214215 , testGroup "Literal"