@@ -272,13 +272,12 @@ orderedListMarkers (start, numstyle, numdelim) =
272-- remove empty Str elements.
272-- remove empty Str elements.
273normalizeSpaces :: [Inline] -> [Inline]
273normalizeSpaces :: [Inline] -> [Inline]
274normalizeSpaces = cleanup . dropWhile isSpaceOrEmpty
274normalizeSpaces = cleanup . dropWhile isSpaceOrEmpty
275− where cleanup [] = []
275+ where cleanup [] = []
276− cleanup (Space:rest) = let rest' = dropWhile isSpaceOrEmpty rest
276+ cleanup (Space:rest) = case dropWhile isSpaceOrEmpty rest of
278− [] -> []
277+ [] -> []
279− _ -> Space : cleanup rest'
278+ (x:xs) -> Space : x : cleanup xs
280 cleanup ((Str ""):rest) = cleanup rest
279 cleanup ((Str ""):rest) = cleanup rest
281− cleanup (x:rest) = x : cleanup rest
280+ cleanup (x:rest) = x : cleanup rest
283isSpaceOrEmpty :: Inline -> Bool
282isSpaceOrEmpty :: Inline -> Bool
284isSpaceOrEmpty Space = True
283isSpaceOrEmpty Space = True