aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJesse Rosenthal <jrosenthal@jhu.edu>2014-08-11 12:48:16 -0400
committerJesse Rosenthal <jrosenthal@jhu.edu>2014-08-11 12:48:16 -0400
commit0411fe7ccf26c36f78af58100b9670dd639d2d3b (patch)
treebfe0776e32349e542c63cbde058bfe0ce635e9dd /src/Text
parenta67e5e877dd87fcb19d6d2dcedb399cf2b5bf4f1 (diff)
downloadpandoc-0411fe7ccf26c36f78af58100b9670dd639d2d3b.tar.gz
Docx reader: handle empty reducibles.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Readers/Docx/Reducible.hs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Readers/Docx/Reducible.hs b/src/Text/Pandoc/Readers/Docx/Reducible.hs
index 2dbef4131..a852e25bf 100644
--- a/src/Text/Pandoc/Readers/Docx/Reducible.hs
+++ b/src/Text/Pandoc/Readers/Docx/Reducible.hs
@@ -88,11 +88,13 @@ combineReducibles r s =
in
case null shared of
True | (x : xs) <- reverse rs
- , isSpace x ->
- rebuild conts (reverse xs) ++ [x, s]
+ , isSpace x -> case xs of
+ [] -> [x, s]
+ _ -> rebuild conts (reverse xs) ++ [x, s]
| (x : xs) <- ss
- , isSpace x ->
- [r, x] ++ rebuild conts' (xs)
+ , isSpace x -> case xs of
+ [] -> [r, x]
+ _ -> [r, x] ++ rebuild conts' (xs)
True -> [r,s]
False -> rebuild
shared $
@@ -121,7 +123,6 @@ instance Reducible Inline where
False -> [Span attr2' ils2]
in
[Span attr' $ reduceList $ s1' ++ s2']
-
(Str x) <++> (Str y) = [Str (x++y)]
il <++> il' = combineReducibles il il'