From beda70b92336ebc7d9c8bc0dcb3fafbc45dee0ff Mon Sep 17 00:00:00 2001 From: Jesse Rosenthal Date: Mon, 18 Feb 2019 15:43:54 -0500 Subject: Docx reader: Trim space inside the last inline. We have to add one final mempty when we're combining in order to trim inlines appropriately. (We need to use our own trimming routines here due to the way that formatted inlines are smushed together when converting from docx.) Closes #5273 --- src/Text/Pandoc/Readers/Docx/Combine.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Text/Pandoc/Readers/Docx') diff --git a/src/Text/Pandoc/Readers/Docx/Combine.hs b/src/Text/Pandoc/Readers/Docx/Combine.hs index 855675b37..2fba3394b 100644 --- a/src/Text/Pandoc/Readers/Docx/Combine.hs +++ b/src/Text/Pandoc/Readers/Docx/Combine.hs @@ -166,7 +166,8 @@ isAttrModifier (AttrModifier _ _) = True isAttrModifier _ = False smushInlines :: [Inlines] -> Inlines -smushInlines xs = foldl combineInlines mempty xs +smushInlines xs = combineInlines xs' mempty + where xs' = foldl combineInlines mempty xs smushBlocks :: [Blocks] -> Blocks smushBlocks xs = foldl combineBlocks mempty xs -- cgit v1.2.3