mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-28 03:06:30 +00:00
Muse reader: add <math> tag support
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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>")
|
||||
|
||||
Reference in New Issue
Block a user