aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Readers/Muse.hs26
1 files changed, 5 insertions, 21 deletions
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs
index 201a59fc0..6e4aed94e 100644
--- a/src/Text/Pandoc/Readers/Muse.hs
+++ b/src/Text/Pandoc/Readers/Muse.hs
@@ -186,7 +186,6 @@ blockElements = choice [ comment
, orderedList
, table
, commentTag
- , indentedBlock
, noteBlock
]
@@ -249,27 +248,12 @@ quoteTag = withQuoteContext InDoubleQuote $ blockTag B.blockQuote "quote"
commentTag :: PandocMonad m => MuseParser m (F Blocks)
commentTag = parseHtmlContent "comment" anyChar >> return mempty
--- Indented block is either center, right or quote
-indentedLine :: PandocMonad m => MuseParser m (Int, String)
-indentedLine = try $ do
- indent <- length <$> many1 spaceChar
- line <- anyLine
- return (indent, line)
-
-rawIndentedBlock :: PandocMonad m => MuseParser m (Int, String)
-rawIndentedBlock = try $ do
- lns <- many1 indentedLine
- let indent = minimum $ map fst lns
- return (indent, unlines $ map snd lns)
-
-indentedBlock :: PandocMonad m => MuseParser m (F Blocks)
-indentedBlock = try $ do
- (indent, raw) <- rawIndentedBlock
- contents <- withQuoteContext InDoubleQuote $ parseFromString parseBlocks raw
- return $ (if indent >= 2 && indent < 6 then B.blockQuote else id) <$> contents
-
+-- Indented paragraph is either center, right or quote
para :: PandocMonad m => MuseParser m (F Blocks)
-para = liftM B.para . trimInlinesF . mconcat <$> many1Till inline endOfParaElement
+para = do
+ indent <- length <$> many spaceChar
+ let f = if indent >= 2 && indent < 6 then B.blockQuote else id
+ liftM (f . B.para) . trimInlinesF . mconcat <$> many1Till inline endOfParaElement
where
endOfParaElement = lookAhead $ endOfInput <|> endOfPara <|> newBlockElement
endOfInput = try $ skipMany blankline >> skipSpaces >> eof