git.iko.soy/typeable/pandoc
on master help sign in
Muse reader: allow URL to be empty
9cc2bf0Alexander Krotov
src/Text/Pandoc/Readers/Muse.hs+1−1
@@ -972,7 +972,7 @@ linkContent = char '[' >> trimInlinesF . mconcat <$> manyTill inline (string "]"
972linkText :: PandocMonad m => MuseParser m (String, Maybe (F Inlines))
972linkText :: PandocMonad m => MuseParser m (String, Maybe (F Inlines))
973linkText = do
973linkText = do
974 string "[["
974 string "[["
975− url <- many1Till anyChar $ char ']'
975+ url <- manyTill anyChar $ char ']'
976 content <- optionMaybe linkContent
976 content <- optionMaybe linkContent
977 char ']'
977 char ']'
978 return (url, content)
978 return (url, content)
test/Tests/Readers/Muse.hs+1
@@ -209,6 +209,7 @@ tests =
209 -- This test also makes sure '=' without whitespace is not treated as code markup
209 -- This test also makes sure '=' without whitespace is not treated as code markup
210 , "No implicit links" =: "http://example.org/index.php?action=view&id=1"
210 , "No implicit links" =: "http://example.org/index.php?action=view&id=1"
211 =?> para "http://example.org/index.php?action=view&id=1"
211 =?> para "http://example.org/index.php?action=view&id=1"
212+ , "Link with empty URL" =: "[[][empty URL]]" =?> para (link "" "" (text "empty URL"))
212 ]
213 ]
213
214
214 , testGroup "Literal"
215 , testGroup "Literal"