Muse reader: allow links to have empty descriptions
This commit is contained in:
parent
a3f659d2c0
commit
79592db66c
2 changed files with 4 additions and 1 deletions
|
@ -931,7 +931,7 @@ link = try $ do
|
|||
linkContent :: PandocMonad m => MuseParser m (F Inlines)
|
||||
linkContent = do
|
||||
char '['
|
||||
trimInlinesF . mconcat <$> many1Till inline (string "]")
|
||||
trimInlinesF . mconcat <$> manyTill inline (string "]")
|
||||
|
||||
linkText :: PandocMonad m => MuseParser m (String, String, Maybe (F Inlines))
|
||||
linkText = do
|
||||
|
|
|
@ -186,6 +186,9 @@ tests =
|
|||
, "Link with description" =:
|
||||
"[[https://amusewiki.org/][A Muse Wiki]]" =?>
|
||||
para (link "https://amusewiki.org/" "" (text "A Muse Wiki"))
|
||||
, "Link with empty description" =:
|
||||
"[[https://amusewiki.org/][]]" =?>
|
||||
para (link "https://amusewiki.org/" "" (text ""))
|
||||
, "Image" =:
|
||||
"[[image.jpg]]" =?>
|
||||
para (image "image.jpg" "" mempty)
|
||||
|
|
Loading…
Add table
Reference in a new issue