@@ -228,24 +228,28 @@ example = try $ do
228 contents <- manyTill anyChar $ try (optionMaybe blankline >> string "}}}")
228 contents <- manyTill anyChar $ try (optionMaybe blankline >> string "}}}")
229 return $ return $ B.codeBlock contents
229 return $ return $ B.codeBlock contents
231−exampleTag :: PandocMonad m => MuseParser m (F Blocks)
231+-- Trim up to one newline from the beginning and the end,
232−exampleTag = do
232+-- in case opening and/or closing tags are on separate lines.
233− (attr, contents) <- htmlElement "example"
233+chop :: String -> String
234− return $ return $ B.codeBlockWith attr $ chop contents
234+chop = lchop . rchop
235 where lchop s = case s of
235 where lchop s = case s of
236 '\n':ss -> ss
236 '\n':ss -> ss
238 rchop = reverse . lchop . reverse
238 rchop = reverse . lchop . reverse
239− -- Trim up to one newline from the beginning and the end,
239+
240− -- in case opening and/or closing tags are on separate lines.
240+exampleTag :: PandocMonad m => MuseParser m (F Blocks)
241− chop = lchop . rchop
241+exampleTag = do
242+ (attr, contents) <- htmlElement "example"
243+ return $ return $ B.codeBlockWith attr $ chop contents
243literal :: PandocMonad m => MuseParser m (F Blocks)
245literal :: PandocMonad m => MuseParser m (F Blocks)
247+ guardDisabled Ext_amuse -- Text::Amuse does not support <literal>
244−literal = (return . rawBlock) <$> htmlElement "literal"
248+ (return . rawBlock) <$> htmlElement "literal"
246 -- FIXME: Emacs Muse inserts <literal> without style into all output formats, but we assume HTML
250 -- FIXME: Emacs Muse inserts <literal> without style into all output formats, but we assume HTML
247 format (_, _, kvs) = fromMaybe "html" $ lookup "style" kvs
251 format (_, _, kvs) = fromMaybe "html" $ lookup "style" kvs
248− rawBlock (attrs, content) = B.rawBlock (format attrs) content
252+ rawBlock (attrs, content) = B.rawBlock (format attrs) $ chop content
250blockTag :: PandocMonad m
254blockTag :: PandocMonad m
251 => (Blocks -> Blocks)
255 => (Blocks -> Blocks)