git.iko.soy/typeable/pandoc
on master help sign in
Docx reader: clean up function with `traverse`
commit7ae9621a874f945e3b5e249129384d8bb87850c6 authorJesse Rosenthal <jrosenthal@jhu.edu> dateMon 29 Aug 2016, 18:56 (10 years ago) parenta3a3e3f
1 file changed+1−6
src/Text/Pandoc/Readers/Docx.hs+1−6
src/Text/Pandoc/Readers/Docx.hs+1−6
@@ -421,12 +421,7 @@ dummyAnchors :: [String]
421421dummyAnchors = ["_GoBack"]
422422
423423makeHeaderAnchor :: Blocks -> DocxContext Blocks
424−makeHeaderAnchor bs = case viewl $ unMany bs of
425− (x :< xs) -> do
426− x' <- (makeHeaderAnchor' x)
427− xs' <- (makeHeaderAnchor $ Many xs)
428− return $ (singleton x') <> xs'
429− EmptyL -> return mempty
424+makeHeaderAnchor bs = traverse makeHeaderAnchor' bs
430425
431426makeHeaderAnchor' :: Block -> DocxContext Block
432427-- If there is an anchor already there (an anchor span in the header,