Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove several unnecessary layers of indirection from refs #10458

Merged
merged 1 commit into from
Dec 15, 2024

Conversation

josephcsible
Copy link
Contributor

No description provided.

@jgm
Copy link
Owner

jgm commented Dec 14, 2024

This looks right to me. Have you tested it on a real-world case that would exercise this code, just to make sure?

@josephcsible
Copy link
Contributor Author

It passes both the zotero with +citations and mendeley with +citations unit tests. To confirm those exercise this code, I tried with this intentionally-wrong change:

diff --git a/src/Text/Pandoc/Readers/Docx.hs b/src/Text/Pandoc/Readers/Docx.hs
index 7abbc461d..12106b2ea 100644
--- a/src/Text/Pandoc/Readers/Docx.hs
+++ b/src/Text/Pandoc/Readers/Docx.hs
@@ -551,7 +551,7 @@ handleCitation citation = do
                                         -- see #10366, sometimes itemData has a different
                                         -- id and we need to use the same one:
                                         itemData{ referenceId =
-                                                    Citeproc.citationItemId item })
+                                                    ItemId "wrong" })
                                   (Citeproc.citationItemData item)) items
   modify $ \st ->
     st{ docxReferences = foldr

And that made both of them fail.

@jgm jgm merged commit 48d83b6 into jgm:main Dec 15, 2024
9 of 12 checks passed
@josephcsible josephcsible deleted the simplify-refs branch December 15, 2024 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants