@@ -422,17 +422,12 @@ exampleTag = try $ do
422422-- | Parse a @\<literal>@ tag as a raw block.
423423-- For 'RawInline' @\<literal>@ parser, see 'inlineLiteralTag'.
424424literalTag :: PandocMonad m => MuseParser m (F Blocks)
425−literalTag = try $ do
426− many spaceChar
427− attr <- htmlAttrToPandoc <$> openTag "literal"
428− manyTill spaceChar eol
429− content <- manyTill anyChar $ closeTag "literal"
430− manyTill spaceChar eol
431− return $ return $ rawBlock (attr, content)
432− where
433− -- FIXME: Emacs Muse inserts <literal> without style into all output formats, but we assume HTML
434− format (_, _, kvs) = fromMaybe "html" $ lookup "style" kvs
435− rawBlock (attrs, content) = B.rawBlock (format attrs) $ rchop $ intercalate "\n" $ dropSpacePrefix $ splitOn "\n" $ lchop content
425+literalTag = try $ fmap pure $ B.rawBlock
426+ <$ many spaceChar
427+ <*> (fromMaybe "html" . lookup "style" <$> openTag "literal") -- FIXME: Emacs Muse inserts <literal> without style into all output formats, but we assume HTML
428+ <* manyTill spaceChar eol
429+ <*> (rchop . intercalate "\n" . dropSpacePrefix . splitOn "\n" . lchop <$> manyTill anyChar (closeTag "literal"))
430+ <* manyTill spaceChar eol
436431
437432-- | Parse @\<center>@ tag.
438433-- Currently it is ignored as Pandoc cannot represent centered blocks.
@@ -938,12 +933,9 @@ mathTag = return . B.math . snd <$> htmlElement "math"
938933
939934-- | Parse inline @\<literal>@ tag as a raw inline.
940935inlineLiteralTag :: PandocMonad m => MuseParser m (F Inlines)
941−inlineLiteralTag =
942− (return . rawInline) <$> htmlElement "literal"
943− where
944− -- FIXME: Emacs Muse inserts <literal> without style into all output formats, but we assume HTML
945− format (_, _, kvs) = fromMaybe "html" $ lookup "style" kvs
946− rawInline (attrs, content) = B.rawInline (format attrs) content
936+inlineLiteralTag = try $ fmap pure $ B.rawInline
937+ <$> (fromMaybe "html" . lookup "style" <$> openTag "literal") -- FIXME: Emacs Muse inserts <literal> without style into all output formats, but we assume HTML
938+ <*> manyTill anyChar (closeTag "literal")
947939
948940str :: PandocMonad m => MuseParser m (F Inlines)
949941str = return . B.str <$> many1 alphaNum <* updateLastStrPos