git.iko.soy/typeable/pandoc
on master help sign in
Avoid a non-exhaustive pattern match.
ec89628John MacFarlane
src/Text/Pandoc/Readers/Docx/Lists.hs+2−3
@@ -183,14 +183,13 @@ blocksToDefinitions' defAcc acc
183 pair = if remainingAttr2 == ("", [], []) then (concatMap plainParaInlines blks1, [blks2]) else (concatMap plainParaInlines blks1, [[Div remainingAttr2 blks2]])
183 pair = if remainingAttr2 == ("", [], []) then (concatMap plainParaInlines blks1, [blks2]) else (concatMap plainParaInlines blks1, [[Div remainingAttr2 blks2]])
184 in
184 in
185 blocksToDefinitions' (pair : defAcc) acc blks
185 blocksToDefinitions' (pair : defAcc) acc blks
186−blocksToDefinitions' defAcc acc
186+blocksToDefinitions' ((defTerm, defItems):defs) acc
187 (Div (ident2, classes2, kvs2) blks2 : blks)
187 (Div (ident2, classes2, kvs2) blks2 : blks)
188− | (not . null) defAcc && "Definition" `elem` classes2 =
188+ | "Definition" `elem` classes2 =
189 let remainingAttr2 = (ident2, delete "Definition" classes2, kvs2)
189 let remainingAttr2 = (ident2, delete "Definition" classes2, kvs2)
190 defItems2 = case remainingAttr2 == ("", [], []) of
190 defItems2 = case remainingAttr2 == ("", [], []) of
191 True -> blks2
191 True -> blks2
192 False -> [Div remainingAttr2 blks2]
192 False -> [Div remainingAttr2 blks2]
193− ((defTerm, defItems):defs) = defAcc
194 defAcc' = case null defItems of
193 defAcc' = case null defItems of
195 True -> (defTerm, [defItems2]) : defs
194 True -> (defTerm, [defItems2]) : defs
196 False -> (defTerm, init defItems ++ [last defItems ++ defItems2]) : defs
195 False -> (defTerm, init defItems ++ [last defItems ++ defItems2]) : defs