From 7ae9621a874f945e3b5e249129384d8bb87850c6 Mon Sep 17 00:00:00 2001 From: Jesse Rosenthal Date: Mon, 29 Aug 2016 18:56:24 -0400 Subject: Docx reader: clean up function with `traverse` --- src/Text/Pandoc/Readers/Docx.hs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/Text/Pandoc/Readers') diff --git a/src/Text/Pandoc/Readers/Docx.hs b/src/Text/Pandoc/Readers/Docx.hs index 3f90a56e9..7ef3e7554 100644 --- a/src/Text/Pandoc/Readers/Docx.hs +++ b/src/Text/Pandoc/Readers/Docx.hs @@ -421,12 +421,7 @@ dummyAnchors :: [String] dummyAnchors = ["_GoBack"] makeHeaderAnchor :: Blocks -> DocxContext Blocks -makeHeaderAnchor bs = case viewl $ unMany bs of - (x :< xs) -> do - x' <- (makeHeaderAnchor' x) - xs' <- (makeHeaderAnchor $ Many xs) - return $ (singleton x') <> xs' - EmptyL -> return mempty +makeHeaderAnchor bs = traverse makeHeaderAnchor' bs makeHeaderAnchor' :: Block -> DocxContext Block -- If there is an anchor already there (an anchor span in the header, -- cgit v1.2.3