Docx reader: clean up function with traverse
This commit is contained in:
parent
a3a3e3fdbf
commit
7ae9621a87
1 changed files with 1 additions and 6 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue