diff options
-rw-r--r-- | src/Text/Pandoc/Readers/Muse.hs | 17 | ||||
-rw-r--r-- | test/Tests/Readers/Muse.hs | 17 |
2 files changed, 32 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs index b125ccd6a..00ae85674 100644 --- a/src/Text/Pandoc/Readers/Muse.hs +++ b/src/Text/Pandoc/Readers/Muse.hs @@ -36,8 +36,7 @@ TODO: - Org tables - table.el tables - Images with attributes (floating and width) -- Citations and <biblio> -- <play> environment +- <cite> tag -} module Text.Pandoc.Readers.Muse (readMuse) where @@ -322,6 +321,8 @@ blockElements = do , rightTag , quoteTag , divTag + , biblioTag + , playTag , verseTag , lineBlock , table @@ -413,6 +414,18 @@ divTag = do (attrs, content) <- parseHtmlContent "div" return $ B.divWith attrs <$> content +-- <biblio> tag is supported by Amusewiki only +biblioTag :: PandocMonad m => MuseParser m (F Blocks) +biblioTag = do + guardEnabled Ext_amuse + fmap (B.divWith ("", ["biblio"], [])) . snd <$> parseHtmlContent "biblio" + +-- <play> tag is supported by Amusewiki only +playTag :: PandocMonad m => MuseParser m (F Blocks) +playTag = do + guardEnabled Ext_amuse + fmap (B.divWith ("", ["play"], [])) . snd <$> parseHtmlContent "play" + verseLine :: PandocMonad m => MuseParser m (F Inlines) verseLine = do indent <- (B.str <$> many1 (char ' ' >> pure '\160')) <|> pure mempty diff --git a/test/Tests/Readers/Muse.hs b/test/Tests/Readers/Muse.hs index fd96c892e..77b18e066 100644 --- a/test/Tests/Readers/Muse.hs +++ b/test/Tests/Readers/Muse.hs @@ -281,6 +281,23 @@ tests = ] =?> divWith ("foo", [], []) (para "Foo bar") ] + , "Biblio" =: + T.unlines [ "<biblio>" + , "" + , "Author, *Title*, description" + , "" + , "Another author, *Another title*, another description" + , "" + , "</biblio>" + ] =?> + divWith ("", ["biblio"], []) (para (text "Author, " <> emph "Title" <> ", description") <> + para (text "Another author, " <> emph "Another title" <> text ", another description")) + , "Play" =: + T.unlines [ "<play>" + , "Foo bar" + , "</play>" + ] =?> + divWith ("", ["play"], []) (para "Foo bar") , "Verse" =: T.unlines [ "> This is" , "> First stanza" |