git.iko.soy/typeable/pandoc
on master help sign in
Merge pull request #3913 from labdsf/muse-reader-verbatim

Muse reader: parse verbatim tag

commit7df095f049d8499972af966d4622d20b5a465900 authorJohn MacFarlane <jgm@berkeley.edu> dateMon 11 Sep 2017, 07:35 (9 years ago) parent41a16a127cccfa
2 files changed+8−1
src/Text/Pandoc/Readers/Muse.hs+6−1 test/Tests/Readers/Muse.hs+2
src/Text/Pandoc/Readers/Muse.hs+6−1
@@ -39,7 +39,6 @@ TODO:
3939- Anchors
4040- Citations and <biblio>
4141- <play> environment
42−- <verbatim> tag
4342-}
4443module Text.Pandoc.Readers.Muse (readMuse) where
4544
@@ -537,6 +536,7 @@ inline = choice [ br
537536 , superscriptTag
538537 , subscriptTag
539538 , strikeoutTag
539+ , verbatimTag
540540 , link
541541 , code
542542 , codeTag
@@ -613,6 +613,11 @@ subscriptTag = inlineTag B.subscript "sub"
613613strikeoutTag :: PandocMonad m => MuseParser m (F Inlines)
614614strikeoutTag = inlineTag B.strikeout "del"
615615
616+verbatimTag :: PandocMonad m => MuseParser m (F Inlines)
617+verbatimTag = do
618+ content <- parseHtmlContent "verbatim" anyChar
619+ return $ return $ B.text $ fromEntities content
620+
616621code :: PandocMonad m => MuseParser m (F Inlines)
617622code = try $ do
618623 pos <- getPosition
test/Tests/Readers/Muse.hs+2
@@ -108,6 +108,8 @@ tests =
108108
109109 , "Code tag" =: "<code>foo(bar)</code>" =?> para (code "foo(bar)")
110110
111+ , "Verbatim tag" =: "*<verbatim>*</verbatim>*" =?> para (emph "*")
112+
111113 , testGroup "Links"
112114 [ "Link without description" =:
113115 "[[https://amusewiki.org/]]" =?>