From 2165efef7e3608b5c8e7f144b4f3884635410bc5 Mon Sep 17 00:00:00 2001 From: danse Date: Mon, 15 Jan 2018 12:24:20 +0100 Subject: in RST writer insert comment between lists and quotes, closes #4248 --- src/Text/Pandoc/Writers/RST.hs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Text/Pandoc/Writers/RST.hs b/src/Text/Pandoc/Writers/RST.hs index 2b28dccf0..694d623a6 100644 --- a/src/Text/Pandoc/Writers/RST.hs +++ b/src/Text/Pandoc/Writers/RST.hs @@ -353,9 +353,20 @@ blockListToRST' :: PandocMonad m -> [Block] -- ^ List of block elements -> RST m Doc blockListToRST' topLevel blocks = do + -- insert comment between list and quoted blocks, see #4248 + let fixBlocks (b1:b2@(BlockQuote _):bs) + | isList b1 = b1 : commentSep : b2 : fixBlocks bs + where + isList (BulletList _) = True + isList (OrderedList _ _) = True + isList (DefinitionList _) = True + isList _ = False + commentSep = RawBlock "rst" "" + fixBlocks (b:bs) = b : fixBlocks bs + fixBlocks [] = [] tl <- gets stTopLevel modify (\s->s{stTopLevel=topLevel, stLastNested=False}) - res <- vcat `fmap` mapM blockToRST' blocks + res <- vcat `fmap` mapM blockToRST' (fixBlocks blocks) modify (\s->s{stTopLevel=tl}) return res -- cgit v1.2.3