summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/RST.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/Writers/RST.hs')
-rw-r--r--src/Text/Pandoc/Writers/RST.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Writers/RST.hs b/src/Text/Pandoc/Writers/RST.hs
index 8b2563eb4..9184e0200 100644
--- a/src/Text/Pandoc/Writers/RST.hs
+++ b/src/Text/Pandoc/Writers/RST.hs
@@ -59,9 +59,10 @@ escapeString = backslashEscape "`\\|*_"
-- and another containing references.
wrappedRST :: [Inline] -> (Doc, Doc)
wrappedRST lst =
- let words = splitBySpace lst in
- ( fsep $ map (fcat . (map (fst . inlineToRST))) words,
- vcat (map (snd . inlineToRST) lst) )
+ let wrap_section sec = fsep $ map (fst . inlineListToRST) $
+ (splitBy Space sec) in
+ ((vcat $ map wrap_section $ (splitBy LineBreak lst)),
+ vcat $ map (snd . inlineToRST) lst)
-- | Remove reference keys, and make sure there are blanks before each list.
reformatBlocks :: [Block] -> [Block]