Muse reader: add <math> tag support

This commit is contained in:
Alexander Krotov
2018-04-02 17:19:26 +03:00
parent dfbae03810
commit 2380845206
2 changed files with 7 additions and 0 deletions
+5
View File
@@ -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"
+2
View File
@@ -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>")