aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-09-11 07:35:14 -0700
committerGitHub <noreply@github.com>2017-09-11 07:35:14 -0700
commit7df095f049d8499972af966d4622d20b5a465900 (patch)
tree2b3657b4f97f97589d1eaad8b120d52c175408c0
parent41a16a1e9dbfd62d430fb7c5a75b8c3e207d383f (diff)
parent27cccfac849d644e1f722314cefa1ae212227d18 (diff)
downloadpandoc-7df095f049d8499972af966d4622d20b5a465900.tar.gz
Merge pull request #3913 from labdsf/muse-reader-verbatim
Muse reader: parse verbatim tag
-rw-r--r--src/Text/Pandoc/Readers/Muse.hs7
-rw-r--r--test/Tests/Readers/Muse.hs2
2 files changed, 8 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs
index f70085c54..ab9a51bad 100644
--- a/src/Text/Pandoc/Readers/Muse.hs
+++ b/src/Text/Pandoc/Readers/Muse.hs
@@ -39,7 +39,6 @@ TODO:
- Anchors
- Citations and <biblio>
- <play> environment
-- <verbatim> tag
-}
module Text.Pandoc.Readers.Muse (readMuse) where
@@ -537,6 +536,7 @@ inline = choice [ br
, superscriptTag
, subscriptTag
, strikeoutTag
+ , verbatimTag
, link
, code
, codeTag
@@ -613,6 +613,11 @@ subscriptTag = inlineTag B.subscript "sub"
strikeoutTag :: PandocMonad m => MuseParser m (F Inlines)
strikeoutTag = inlineTag B.strikeout "del"
+verbatimTag :: PandocMonad m => MuseParser m (F Inlines)
+verbatimTag = do
+ content <- parseHtmlContent "verbatim" anyChar
+ return $ return $ B.text $ fromEntities content
+
code :: PandocMonad m => MuseParser m (F Inlines)
code = try $ do
pos <- getPosition
diff --git a/test/Tests/Readers/Muse.hs b/test/Tests/Readers/Muse.hs
index 43a1d0697..66c6ea7f2 100644
--- a/test/Tests/Readers/Muse.hs
+++ b/test/Tests/Readers/Muse.hs
@@ -108,6 +108,8 @@ tests =
, "Code tag" =: "<code>foo(bar)</code>" =?> para (code "foo(bar)")
+ , "Verbatim tag" =: "*<verbatim>*</verbatim>*" =?> para (emph "*")
+
, testGroup "Links"
[ "Link without description" =:
"[[https://amusewiki.org/]]" =?>