diff options
author | Alexander Krotov <ilabdsf@gmail.com> | 2017-11-21 19:19:49 +0300 |
---|---|---|
committer | Alexander Krotov <ilabdsf@gmail.com> | 2017-11-21 19:53:55 +0300 |
commit | 6c17117ef2e0ef6082ab55cf67256e59ea93ddf8 (patch) | |
tree | f52186da86653252271fd430f6db637f4398bb53 /src/Text/Pandoc | |
parent | 1c85a158f346e56e6e2cd8da79eca379fc4ce684 (diff) | |
download | pandoc-6c17117ef2e0ef6082ab55cf67256e59ea93ddf8.tar.gz |
Muse reader: add inline <literal> support
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Readers/Muse.hs | 11 |
1 files changed, 11 insertions, 0 deletions
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 <literal> + (attrs, content) <- parseHtmlContentWithAttrs "literal" anyChar + return $ return $ rawInline (attrs, content) + where + -- FIXME: Emacs Muse inserts <literal> 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) |