summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
diff options
context:
space:
mode:
authordanse <f.occhipinti@gmail.com>2018-01-15 12:24:20 +0100
committerdanse <f.occhipinti@gmail.com>2018-01-19 15:57:54 +0100
commit2165efef7e3608b5c8e7f144b4f3884635410bc5 (patch)
treecca4c2c896823725c735be13376b31eb3dbcf51c /src/Text/Pandoc/Writers
parent01499b766b16f4ab1c7ce4e3e82780a099c6dd37 (diff)
in RST writer insert comment between lists and quotes, closes #4248
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r--src/Text/Pandoc/Writers/RST.hs13
1 files changed, 12 insertions, 1 deletions
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