aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Krotov <ilabdsf@gmail.com>2017-12-31 00:26:05 +0300
committerAlexander Krotov <ilabdsf@gmail.com>2017-12-31 00:30:26 +0300
commitdebc6d13aa4aba79d957757ba8802cef65187afc (patch)
treeccb3b2660e6f21375d8da55c63518839af1bf2e2
parent07b06cb6e6948df98fb3ffe1e9c2673db158feb2 (diff)
downloadpandoc-debc6d13aa4aba79d957757ba8802cef65187afc.tar.gz
Muse reader: automatically translate #cover into #cover-image
Amusewiki uses #cover directive to specify cover image.
-rw-r--r--src/Text/Pandoc/Readers/Muse.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs
index 7142c249f..d86b47e83 100644
--- a/src/Text/Pandoc/Readers/Muse.hs
+++ b/src/Text/Pandoc/Readers/Muse.hs
@@ -179,7 +179,9 @@ directive :: PandocMonad m => MuseParser m ()
directive = do
ext <- getOption readerExtensions
(key, value) <- if extensionEnabled Ext_amuse ext then parseAmuseDirective else parseEmacsDirective
- updateState $ \st -> st { stateMeta' = B.setMeta key <$> value <*> stateMeta' st }
+ updateState $ \st -> st { stateMeta' = B.setMeta (translateKey key) <$> value <*> stateMeta' st }
+ where translateKey "cover" = "cover-image"
+ translateKey x = x
--
-- block parsers