git.iko.soy/typeable/pandoc
on master help sign in
Docx reader: clean up function with `traverse`
7ae9621Jesse Rosenthal
src/Text/Pandoc/Readers/Docx.hs+1−6
@@ -421,12 +421,7 @@ dummyAnchors :: [String]
421dummyAnchors = ["_GoBack"]
421dummyAnchors = ["_GoBack"]
422
422
423makeHeaderAnchor :: Blocks -> DocxContext Blocks
423makeHeaderAnchor :: Blocks -> DocxContext Blocks
424−makeHeaderAnchor bs = case viewl $ unMany bs of
425− (x :< xs) -> do
426− x' <- (makeHeaderAnchor' x)
427− xs' <- (makeHeaderAnchor $ Many xs)
424+makeHeaderAnchor bs = traverse makeHeaderAnchor' bs
428− return $ (singleton x') <> xs'
429− EmptyL -> return mempty
430
425
431makeHeaderAnchor' :: Block -> DocxContext Block
426makeHeaderAnchor' :: Block -> DocxContext Block
432-- If there is an anchor already there (an anchor span in the header,
427-- If there is an anchor already there (an anchor span in the header,