diff options
author | Francesco Occhipinti <focchi.pinti@gmail.com> | 2018-04-27 18:01:20 +0200 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2018-04-27 09:01:20 -0700 |
commit | 8b01f03eaa0c73259ed7a6d73c649cac65edcddc (patch) | |
tree | 8ca758118f491187f100985ac09532cdb3f6f8b3 /src | |
parent | 245c8d92ec2a412906760c67bebbb8f9ef81b54c (diff) | |
download | pandoc-8b01f03eaa0c73259ed7a6d73c649cac65edcddc.tar.gz |
RST writer: preserve empty inline parents in flatten (#4603)
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Writers/RST.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/RST.hs b/src/Text/Pandoc/Writers/RST.hs index 084615357..f82597c55 100644 --- a/src/Text/Pandoc/Writers/RST.hs +++ b/src/Text/Pandoc/Writers/RST.hs @@ -457,8 +457,11 @@ transformInlines = insertBS . -- them either collapsing them in the outer inline container or -- pulling them out of it flatten :: Inline -> [Inline] -flatten outer = combineAll $ dropInlineParent outer - where combineAll = foldl combine [] +flatten outer + | null contents = [outer] + | otherwise = combineAll contents + where contents = dropInlineParent outer + combineAll = foldl combine [] combine :: [Inline] -> Inline -> [Inline] combine f i = |