diff options
author | Alexander Krotov <ilabdsf@gmail.com> | 2017-11-25 18:59:03 +0300 |
---|---|---|
committer | Alexander Krotov <ilabdsf@gmail.com> | 2017-11-25 18:59:03 +0300 |
commit | 887977c421e50f8dc84bd738a401bb3f833f2129 (patch) | |
tree | 6125d15a71ad8173da6ab52f3db079d1f4f75951 /src/Text/Pandoc/Readers | |
parent | cce45f858d221feba4b10b90f9f0dba7e23d2ee8 (diff) | |
download | pandoc-887977c421e50f8dc84bd738a401bb3f833f2129.tar.gz |
Muse reader: remove `nested`
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r-- | src/Text/Pandoc/Readers/Muse.hs | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs index c6a66a1ed..56ca9b640 100644 --- a/src/Text/Pandoc/Readers/Muse.hs +++ b/src/Text/Pandoc/Readers/Muse.hs @@ -55,7 +55,7 @@ import Text.Pandoc.Class (PandocMonad (..)) import Text.Pandoc.Definition import Text.Pandoc.Logging import Text.Pandoc.Options -import Text.Pandoc.Parsing hiding (nested) +import Text.Pandoc.Parsing import Text.Pandoc.Readers.HTML (htmlTag) import Text.Pandoc.Shared (crFilter) import Text.Pandoc.XML (fromEntities) @@ -102,15 +102,6 @@ parseBlocks = do eol :: Stream s m Char => ParserT s st m () eol = void newline <|> eof -nested :: PandocMonad m => MuseParser m a -> MuseParser m a -nested p = do - nestlevel <- stateMaxNestingLevel <$> getState - guard $ nestlevel > 0 - updateState $ \st -> st{ stateMaxNestingLevel = stateMaxNestingLevel st - 1 } - res <- p - updateState $ \st -> st{ stateMaxNestingLevel = nestlevel } - return res - htmlElement :: PandocMonad m => String -> MuseParser m (Attr, String) htmlElement tag = try $ do (TagOpen _ attr, _) <- htmlTag (~== TagOpen tag []) @@ -133,7 +124,7 @@ parseHtmlContentWithAttrs tag parser = do parsedContent <- parseContent (content ++ "\n") return (attr, parsedContent) where - parseContent = parseFromString $ nested $ manyTill parser endOfContent + parseContent = parseFromString $ manyTill parser endOfContent endOfContent = try $ skipMany blankline >> skipSpaces >> eof parseHtmlContent :: PandocMonad m => String -> MuseParser m a -> MuseParser m [a] |