git.iko.soy/typeable/pandoc
on master help sign in
hlint Muse reader
841784fAlexander Krotov
src/Text/Pandoc/Readers/Muse.hs+5−6
@@ -124,7 +124,7 @@ parseMuse = do
124 many directive
124 many directive
125 firstSection <- parseBlocks
125 firstSection <- parseBlocks
126 rest <- many parseSection
126 rest <- many parseSection
127− let blocks = mconcat $ (firstSection : rest)
127+ let blocks = mconcat (firstSection : rest)
128 st <- getState
128 st <- getState
129 let doc = runF (do Pandoc _ bs <- B.doc <$> blocks
129 let doc = runF (do Pandoc _ bs <- B.doc <$> blocks
130 meta <- museMeta st
130 meta <- museMeta st
@@ -182,8 +182,7 @@ openTag :: PandocMonad m => String -> MuseParser m [(String, String)]
182openTag tag = try $ do
182openTag tag = try $ do
183 char '<'
183 char '<'
184 string tag
184 string tag
185− attrs <- manyTill attr (char '>')
185+ manyTill attr (char '>')
186− return attrs
187 where
186 where
188 attr = try $ do
187 attr = try $ do
189 many1 spaceChar
188 many1 spaceChar
@@ -278,8 +277,8 @@ parseBlocks =
278 where
277 where
279 nextSection = mempty <$ lookAhead headingStart
278 nextSection = mempty <$ lookAhead headingStart
280 parseEnd = mempty <$ eof
279 parseEnd = mempty <$ eof
281− blockStart = ((B.<>) <$> (blockElements <|> emacsNoteBlock)
280+ blockStart = (B.<>) <$> (blockElements <|> emacsNoteBlock)
282− <*> parseBlocks)
281+ <*> parseBlocks
283 listStart = do
282 listStart = do
284 updateState (\st -> st { museInPara = False })
283 updateState (\st -> st { museInPara = False })
285 uncurry (B.<>) <$> (anyListUntil parseBlocks <|> amuseNoteBlockUntil parseBlocks)
284 uncurry (B.<>) <$> (anyListUntil parseBlocks <|> amuseNoteBlockUntil parseBlocks)
@@ -293,7 +292,7 @@ parseSection :: PandocMonad m
293 => MuseParser m (F Blocks)
292 => MuseParser m (F Blocks)
294parseSection =
293parseSection =
295 ((B.<>) <$> emacsHeading <*> parseBlocks) <|>
294 ((B.<>) <$> emacsHeading <*> parseBlocks) <|>
296− ((uncurry (B.<>)) <$> amuseHeadingUntil parseBlocks)
295+ (uncurry (B.<>) <$> amuseHeadingUntil parseBlocks)
297
296
298parseBlocksTill :: PandocMonad m
297parseBlocksTill :: PandocMonad m
299 => MuseParser m a
298 => MuseParser m a