git.iko.soy/typeable/pandoc
on master help sign in
Muse reader: move end-of-line parsing to paraUntil
commit02cb6eb47794d6af650b2d504400c61eccc8d18c authorAlexander Krotov <ilabdsf@gmail.com> dateSun 11 Feb 2018, 19:30 (9 years ago) parent018d8aa
1 file changed+3−3
src/Text/Pandoc/Readers/Muse.hs+3−3
src/Text/Pandoc/Readers/Muse.hs+3−3
@@ -259,7 +259,7 @@ parseBlocks =
259259 blockStart = do first <- blockElements
260260 rest <- parseBlocks
261261 return $ first B.<> rest
262− paraStart = do (first, rest) <- paraUntil ((mempty <$ eof) <|> (blankline >> blockStart))
262+ paraStart = do (first, rest) <- paraUntil ((mempty <$ eof) <|> blockStart)
263263 return $ first B.<> rest
264264
265265parseBlock :: PandocMonad m => MuseParser m (F Blocks)
@@ -410,13 +410,13 @@ paraUntil end = do
410410 indent <- length <$> many spaceChar
411411 st <- museInList <$> getState
412412 let f = if not st && indent >= 2 && indent < 6 then B.blockQuote else id
413− (l, e) <- someUntil inline $ try end
413+ (l, e) <- someUntil inline $ try (manyTill spaceChar eol >> end)
414414 let p = fmap (f . B.para) $ trimInlinesF $ mconcat l
415415 return (p, e)
416416
417417para :: PandocMonad m => MuseParser m (F Blocks)
418418para =
419− fst <$> paraUntil (try (eof <|> (blankline >> void (lookAhead blockElements))))
419+ fst <$> paraUntil (try (eof <|> void (lookAhead blockElements)))
420420
421421noteMarker :: PandocMonad m => MuseParser m String
422422noteMarker = try $ do