@@ -903,10 +903,7 @@ symbol = pure . B.str . pure <$> nonspaceChar
903903
904904-- | Parse a link or image.
905905linkOrImage :: PandocMonad m => MuseParser m (F Inlines)
906−linkOrImage = try $ do
907− inLink <- asks museInLink
908− guard $ not inLink
909− local (\s -> s { museInLink = True }) (link "URL:" <|> image <|> link "")
906+linkOrImage = try $ link "URL:" <|> image <|> link ""
910907
911908linkContent :: PandocMonad m => MuseParser m (F Inlines)
912909linkContent = trimInlinesF . mconcat
@@ -916,9 +913,11 @@ linkContent = trimInlinesF . mconcat
916913-- | Parse a link starting with (possibly null) prefix
917914link :: PandocMonad m => String -> MuseParser m (F Inlines)
918915link prefix = try $ do
916+ inLink <- asks museInLink
917+ guard $ not inLink
919918 string $ "[[" ++ prefix
920919 url <- manyTill anyChar $ char ']'
921− content <- option (pure $ B.str url) linkContent
920+ content <- option (pure $ B.str url) (local (\s -> s { museInLink = True }) linkContent)
922921 char ']'
923922 return $ B.link url "" <$> content
924923