@@ -379,16 +379,13 @@ example = try $ do
379 contents <- manyTill anyChar $ try (optional blankline >> string "}}}")
379 contents <- manyTill anyChar $ try (optional blankline >> string "}}}")
380 return $ return $ B.codeBlock contents
380 return $ return $ B.codeBlock contents
382−-- Trim up to one newline from the beginning and the end,
382+-- Trim up to one newline from the beginning of the string.
383−-- in case opening and/or closing tags are on separate lines.
384−chop :: String -> String
387lchop :: String -> String
383lchop :: String -> String
388lchop s = case s of
384lchop s = case s of
389 '\n':ss -> ss
385 '\n':ss -> ss
388+-- Trim up to one newline from the end of the string.
392rchop :: String -> String
389rchop :: String -> String
393rchop = reverse . lchop . reverse
390rchop = reverse . lchop . reverse
@@ -410,7 +407,7 @@ literalTag = do
411 -- FIXME: Emacs Muse inserts <literal> without style into all output formats, but we assume HTML
408 -- FIXME: Emacs Muse inserts <literal> without style into all output formats, but we assume HTML
412 format (_, _, kvs) = fromMaybe "html" $ lookup "style" kvs
409 format (_, _, kvs) = fromMaybe "html" $ lookup "style" kvs
413− rawBlock (attrs, content) = B.rawBlock (format attrs) $ chop content
410+ rawBlock (attrs, content) = B.rawBlock (format attrs) $ rchop $ intercalate "\n" $ dropSpacePrefix $ splitOn "\n" $ lchop content
415-- <center> tag is ignored
412-- <center> tag is ignored
416centerTag :: PandocMonad m => MuseParser m (F Blocks)
413centerTag :: PandocMonad m => MuseParser m (F Blocks)