aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorAlexander Krotov <ilabdsf@gmail.com>2017-11-25 18:59:03 +0300
committerAlexander Krotov <ilabdsf@gmail.com>2017-11-25 18:59:03 +0300
commit887977c421e50f8dc84bd738a401bb3f833f2129 (patch)
tree6125d15a71ad8173da6ab52f3db079d1f4f75951 /src/Text
parentcce45f858d221feba4b10b90f9f0dba7e23d2ee8 (diff)
downloadpandoc-887977c421e50f8dc84bd738a401bb3f833f2129.tar.gz
Muse reader: remove `nested`
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Readers/Muse.hs13
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]