diff options
author | Alexander Krotov <ilabdsf@gmail.com> | 2018-04-07 18:45:30 +0300 |
---|---|---|
committer | Alexander Krotov <ilabdsf@gmail.com> | 2018-04-07 18:45:30 +0300 |
commit | 828bfc749dc043bf9d2ba040cfd5c8c6de946158 (patch) | |
tree | 8e79f4233e92b5e8fbb289870592bd45d8e0a16d | |
parent | ebbd441d062f71c9a347704730f5ea3247527045 (diff) | |
download | pandoc-828bfc749dc043bf9d2ba040cfd5c8c6de946158.tar.gz |
Muse reader: don't return link title from linkText parser
Title is always empty in Muse anyway.
-rw-r--r-- | src/Text/Pandoc/Readers/Muse.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs index 00ae85674..ab99b14be 100644 --- a/src/Text/Pandoc/Readers/Muse.hs +++ b/src/Text/Pandoc/Readers/Muse.hs @@ -897,13 +897,13 @@ link = try $ do st <- getState guard $ not $ museInLink st setState $ st{ museInLink = True } - (url, title, content) <- linkText + (url, content) <- linkText updateState (\state -> state { museInLink = False }) return $ case stripPrefix "URL:" url of Nothing -> if isImageUrl url - then B.image url title <$> fromMaybe (return mempty) content - else B.link url title <$> fromMaybe (return $ B.str url) content - Just url' -> B.link url' title <$> fromMaybe (return $ B.str url') content + then B.image url "" <$> fromMaybe (return mempty) content + else B.link url "" <$> fromMaybe (return $ B.str url) content + Just url' -> B.link url' "" <$> fromMaybe (return $ B.str url') content where -- Taken from muse-image-regexp defined in Emacs Muse file lisp/muse-regexps.el imageExtensions = [".eps", ".gif", ".jpg", ".jpeg", ".pbm", ".png", ".tiff", ".xbm", ".xpm"] isImageUrl = (`elem` imageExtensions) . takeExtension @@ -911,10 +911,10 @@ link = try $ do linkContent :: PandocMonad m => MuseParser m (F Inlines) linkContent = char '[' >> trimInlinesF . mconcat <$> manyTill inline (string "]") -linkText :: PandocMonad m => MuseParser m (String, String, Maybe (F Inlines)) +linkText :: PandocMonad m => MuseParser m (String, Maybe (F Inlines)) linkText = do string "[[" url <- many1Till anyChar $ char ']' content <- optionMaybe linkContent char ']' - return (url, "", content) + return (url, content) |