@@ -98,12 +98,12 @@ import Paths_pandoc (getDataFileName)
9898--
9999
100100-- | Split list by groups of one or more sep.
101−splitBy :: (Eq a) => a -> [a] -> [[a]]
101+splitBy :: (a -> Bool) -> [a] -> [[a]]
102102splitBy _ [] = []
103−splitBy sep lst =
104− let (first, rest) = break (== sep) lst
105− rest' = dropWhile (== sep) rest
106− in first:(splitBy sep rest')
103+splitBy isSep lst =
104+ let (first, rest) = break isSep lst
105+ rest' = dropWhile isSep rest
106+ in first:(splitBy isSep rest')
107107
108108-- | Split list into chunks divided at specified indices.
109109splitByIndices :: [Int] -> [a] -> [[a]]
@@ -227,7 +227,7 @@ tabFilter tabStop =
227227
228228-- | Wrap inlines to line length.
229229wrapped :: Monad m => ([Inline] -> m Doc) -> [Inline] -> m Doc
230−wrapped listWriter sect = (mapM listWriter $ splitBy Space sect) >>=
230+wrapped listWriter sect = (mapM listWriter $ splitBy (== Space) sect) >>=
231231 return . fsep
232232
233233-- | Wrap inlines if the text wrap option is selected.