From a7ac590b083f98bc6c98530077f0ed78e232bc0d Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Wed, 28 Feb 2018 12:11:56 +0300 Subject: Muse reader: allow and other tags to be indented --- src/Text/Pandoc/Readers/Muse.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs index 26da57883..d86c46aca 100644 --- a/src/Text/Pandoc/Readers/Muse.hs +++ b/src/Text/Pandoc/Readers/Muse.hs @@ -153,6 +153,7 @@ htmlElement tag = try $ do htmlBlock :: PandocMonad m => String -> MuseParser m (Attr, String) htmlBlock tag = try $ do + many spaceChar res <- htmlElement tag manyTill spaceChar eol return res @@ -166,7 +167,8 @@ htmlAttrToPandoc attrs = (ident, classes, keyvals) parseHtmlContent :: PandocMonad m => String -> MuseParser m (Attr, F Blocks) -parseHtmlContent tag = do +parseHtmlContent tag = try $ do + many spaceChar (TagOpen _ attr, _) <- htmlTag (~== TagOpen tag []) manyTill spaceChar eol content <- parseBlocksTill (manyTill spaceChar endtag) @@ -398,7 +400,6 @@ dropSpacePrefix lns = exampleTag :: PandocMonad m => MuseParser m (F Blocks) exampleTag = try $ do - many spaceChar (attr, contents) <- htmlBlock "example" return $ return $ B.codeBlockWith attr $ rchop $ intercalate "\n" $ dropSpacePrefix $ splitOn "\n" $ lchop contents -- cgit v1.2.3