@@ -39,6 +39,7 @@ module Text.Pandoc.Readers.Docx.Reducible ((<++>),
3939 innards,
4040 reduceList,
4141 reduceListB,
42+ concatR,
4243 rebuild)
4344 where
4445
@@ -78,6 +79,15 @@ reduceList' as (x:xs) = reduceList' (init as ++ (last as <++> x) ) xs
7879reduceList :: (Reducible a) => [a] -> [a]
7980reduceList = reduceList' []
8081
82+concatR :: (Reducible a) => [a] -> [a] -> [a]
83+concatR [] [] = []
84+concatR [] ss = ss
85+concatR rs [] = rs
86+concatR rs ss = let (x:xs) = reverse rs
87+ (y:ys) = ss
88+ in
89+ reverse xs ++ ( x <++> y ) ++ ys
90+
8191combineReducibles :: (Reducible a, Eq a) => a -> a -> [a]
8292combineReducibles r s =
8393 let (conts, rs) = topLevelContainers r