git.iko.soy/typeable/pandoc
on master help sign in
Docx reader: handle empty reducibles.
commit0411fe7ccf26c36f78af58100b9670dd639d2d3b authorJesse Rosenthal <jrosenthal@jhu.edu> dateMon 11 Aug 2014, 12:48 (12 years ago) parenta67e5e8
1 file changed+6−5
src/Text/Pandoc/Readers/Docx/Reducible.hs+6−5
src/Text/Pandoc/Readers/Docx/Reducible.hs+6−5
@@ -88,11 +88,13 @@ combineReducibles r s =
8888 in
8989 case null shared of
9090 True | (x : xs) <- reverse rs
91− , isSpace x ->
92− rebuild conts (reverse xs) ++ [x, s]
91+ , isSpace x -> case xs of
92+ [] -> [x, s]
93+ _ -> rebuild conts (reverse xs) ++ [x, s]
9394 | (x : xs) <- ss
94− , isSpace x ->
95− [r, x] ++ rebuild conts' (xs)
95+ , isSpace x -> case xs of
96+ [] -> [r, x]
97+ _ -> [r, x] ++ rebuild conts' (xs)
9698 True -> [r,s]
9799 False -> rebuild
98100 shared $
@@ -121,7 +123,6 @@ instance Reducible Inline where
121123 False -> [Span attr2' ils2]
122124 in
123125 [Span attr' $ reduceList $ s1' ++ s2']
124−
125126 (Str x) <++> (Str y) = [Str (x++y)]
126127 il <++> il' = combineReducibles il il'
127128