Skip to content

Commit

Permalink
Remove several unnecessary layers of indirection from refs
Browse files Browse the repository at this point in the history
  • Loading branch information
josephcsible authored and jgm committed Dec 15, 2024
1 parent d04e490 commit 48d83b6
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/Text/Pandoc/Readers/Docx.hs
Original file line number Diff line number Diff line change
Expand Up @@ -547,16 +547,12 @@ handleCitation citation = do
, citationHash = 0 }
let items = Citeproc.citationItems citation
let cs = map toPandocCitation items
refs <- mapM (traverse (return . text)) $
mapMaybe (\item ->
case Citeproc.citationItemData item of
Nothing -> Nothing
Just itemData ->
-- see #10366, sometimes itemData has a different
-- id and we need to use the same one:
Just $ itemData{ referenceId =
Citeproc.citationItemId item })
items
let refs = mapMaybe (\item -> fmap (\itemData -> text <$>
-- see #10366, sometimes itemData has a different
-- id and we need to use the same one:
itemData{ referenceId =
Citeproc.citationItemId item })
(Citeproc.citationItemData item)) items
modify $ \st ->
st{ docxReferences = foldr
(\ref -> M.insert (referenceId ref) ref)
Expand Down

0 comments on commit 48d83b6

Please sign in to comment.