From 6c17117ef2e0ef6082ab55cf67256e59ea93ddf8 Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Tue, 21 Nov 2017 19:19:49 +0300 Subject: Muse reader: add inline support --- src/Text/Pandoc/Readers/Muse.hs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/Text/Pandoc') diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs index 9f1ba1e6c..0a0e86df8 100644 --- a/src/Text/Pandoc/Readers/Muse.hs +++ b/src/Text/Pandoc/Readers/Muse.hs @@ -577,6 +577,7 @@ inlineList = [ endline , link , code , codeTag + , inlineLiteralTag , whitespace , str , symbol @@ -693,6 +694,16 @@ codeTag = do (attrs, content) <- parseHtmlContentWithAttrs "code" anyChar return $ return $ B.codeWith attrs $ fromEntities content +inlineLiteralTag :: PandocMonad m => MuseParser m (F Inlines) +inlineLiteralTag = do + guardDisabled Ext_amuse -- Text::Amuse does not support + (attrs, content) <- parseHtmlContentWithAttrs "literal" anyChar + return $ return $ rawInline (attrs, content) + where + -- FIXME: Emacs Muse inserts without style into all output formats, but we assume HTML + format (_, _, kvs) = fromMaybe "html" $ lookup "style" kvs + rawInline (attrs, content) = B.rawInline (format attrs) $ fromEntities content + str :: PandocMonad m => MuseParser m (F Inlines) str = fmap (return . B.str) (many1 alphaNum <|> count 1 characterReference) -- cgit v1.2.3