aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Readers/Muse.hs5
-rw-r--r--test/Tests/Readers/Muse.hs2
2 files changed, 7 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs
index 9e2ec310d..c3ae0de4e 100644
--- a/src/Text/Pandoc/Readers/Muse.hs
+++ b/src/Text/Pandoc/Readers/Muse.hs
@@ -761,6 +761,7 @@ inlineList = [ whitespace
, link
, code
, codeTag
+ , mathTag
, inlineLiteralTag
, str
, symbol
@@ -882,6 +883,10 @@ code = try $ do
codeTag :: PandocMonad m => MuseParser m (F Inlines)
codeTag = return . uncurry B.codeWith <$> htmlElement "code"
+-- <math> tag is an Emacs Muse extension enabled by (require 'muse-latex2png)
+mathTag :: PandocMonad m => MuseParser m (F Inlines)
+mathTag = return . B.math . snd <$> htmlElement "math"
+
inlineLiteralTag :: PandocMonad m => MuseParser m (F Inlines)
inlineLiteralTag =
(return . rawInline) <$> htmlElement "literal"
diff --git a/test/Tests/Readers/Muse.hs b/test/Tests/Readers/Muse.hs
index 56ad9f249..fd96c892e 100644
--- a/test/Tests/Readers/Muse.hs
+++ b/test/Tests/Readers/Muse.hs
@@ -167,6 +167,8 @@ tests =
, "Code tag" =: "<code>foo(bar)</code>" =?> para (code "foo(bar)")
+ , "Math tag" =: "<math>\\sum_{i=0}^n i^2</math>" =?> para (math "\\sum_{i=0}^n i^2")
+
, "Verbatim tag" =: "*<verbatim>*</verbatim>*" =?> para (emph "*")
, "Verbatim inside code" =: "<code><verbatim>foo</verbatim></code>" =?> para (code "<verbatim>foo</verbatim>")