@@ -305,26 +305,29 @@ parseBlocksTill end =
305305listItemContentsUntil :: PandocMonad m
306306 => Int
307307 -> MuseParser m a
308+ -> MuseParser m a
308309 -> MuseParser m (F Blocks, a)
309−listItemContentsUntil col end =
310+listItemContentsUntil col pre end =
310311 try blockStart <|>
311312 try listStart <|>
312313 try paraStart
313314 where
315+ parsePre = do e <- pre
316+ return (mempty, e)
314317 parseEnd = do e <- end
315318 return (mempty, e)
316319 paraStart = do
317− (first, e) <- paraUntil ((Right <$> continuation) <|> (Left <$> end))
320+ (first, e) <- paraUntil ((Left <$> pre) <|> (Right <$> continuation) <|> (Left <$> end))
318321 case e of
319322 Left ee -> return (first, ee)
320323 Right (rest, ee) -> return (first B.<> rest, ee)
321324 blockStart = do first <- blockElements
322− (rest, e) <- continuation <|> parseEnd
325+ (rest, e) <- parsePre <|> continuation <|> parseEnd
323326 return (first B.<> rest, e)
324327 listStart = do
325328 st <- getState
326329 setState $ st{ museInPara = False }
327− (first, e) <- anyListUntil ((Right <$> continuation) <|> (Left <$> end))
330+ (first, e) <- anyListUntil ((Left <$> pre) <|> (Right <$> continuation) <|> (Left <$> end))
328331 case e of
329332 Left ee -> return (first, ee)
330333 Right (rest, ee) -> return $ (first B.<> rest, ee)
@@ -333,7 +336,7 @@ listItemContentsUntil col end =
333336 indentWith col
334337 st <- getState
335338 setState $ st{ museInPara = museInPara st && isNothing blank }
336− listItemContentsUntil col end
339+ listItemContentsUntil col pre end
337340
338341parseBlock :: PandocMonad m => MuseParser m (F Blocks)
339342parseBlock = do
@@ -554,7 +557,7 @@ bulletListItemsUntil indent end = try $ do
554557 void spaceChar <|> lookAhead eol
555558 st <- getState
556559 setState $ st{ museInPara = False }
557− (x, e) <- listItemContentsUntil (indent + 2) ((Right <$> try (optional blankline >> indentWith indent >> bulletListItemsUntil indent end)) <|> (Left <$> end))
560+ (x, e) <- listItemContentsUntil (indent + 2) (Right <$> try (optional blankline >> indentWith indent >> bulletListItemsUntil indent end)) (Left <$> end)
558561 case e of
559562 Left ee -> return ([x], ee)
560563 Right (xs, ee) -> return (x:xs, ee)
@@ -610,7 +613,7 @@ orderedListItemsUntil indent style end =
610613 void spaceChar <|> lookAhead eol
611614 st <- getState
612615 setState $ st{ museInPara = False }
613− (x, e) <- listItemContentsUntil (sourceColumn pos) ((Right <$> try (optionMaybe blankline >> indentWith indent >> museOrderedListMarker style >> continuation)) <|> (Left <$> end))
616+ (x, e) <- listItemContentsUntil (sourceColumn pos) (Right <$> try (optionMaybe blankline >> indentWith indent >> museOrderedListMarker style >> continuation)) (Left <$> end)
614617 case e of
615618 Left ee -> return ([x], ee)
616619 Right (xs, ee) -> return (x:xs, ee)