git.iko.soy/typeable/pandoc
on master help sign in
Muse reader: avoid parsing newline after paragraph twice

Removed lookAhead from blankline, so it is consumed.

commitc74d2064a7cf40b4c03b1b047a03d24a5fd31645 authorAlexander Krotov <ilabdsf@gmail.com> dateMon 5 Feb 2018, 02:57 (9 years ago) parent1a06f0e
1 file changed+3−5
src/Text/Pandoc/Readers/Muse.hs+3−5
src/Text/Pandoc/Readers/Muse.hs+3−5
@@ -373,12 +373,10 @@ para = do
373373 indent <- length <$> many spaceChar
374374 st <- museInList <$> getState
375375 let f = if not st && indent >= 2 && indent < 6 then B.blockQuote else id
376− res <- fmap (f . B.para) . trimInlinesF . mconcat <$> many1Till inline endOfParaElement
377− manyTill spaceChar eol
378− return res
376+ fmap (f . B.para) . trimInlinesF . mconcat <$> many1Till inline endOfParaElement
379377 where
380− endOfParaElement = lookAhead $ try (eof <|> newBlockElement)
381− newBlockElement = blankline >> void blockElements
378+ endOfParaElement = try (eof <|> newBlockElement)
379+ newBlockElement = blankline >> void (lookAhead blockElements)
382380
383381noteMarker :: PandocMonad m => MuseParser m String
384382noteMarker = try $ do