Skip to content

Commit

Permalink
Add the option {generateGraph: false}
Browse files Browse the repository at this point in the history
The option generateGraph (default: true) generates some graph
information with every bibliography item. When dealing with large bib
files (1MB in my case), this causes a crash in citeproc-js, precisely
here:
https://github.com/Juris-M/citeproc-js/blob/57e3584632fe44db410da1771c4b6bd69fe729f9/src/build.js#L553

The function retrieveItem makes all bib items go through JSON.stringify
and JSON.parse. JSON.stringify crashes on big inputs.

Therefore, it is better to use {generateGraph: false}, I don't think we
loose any feature as far as rehype-citation is concerned.
  • Loading branch information
lairez committed Sep 25, 2024
1 parent 6ae343b commit 0e76a87
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const rehypeCitationGenerator = (Cite) => {
}
}
}
const citations = new Cite(bibtexFile)
const citations = new Cite(bibtexFile, {generateGraph: false});
const citationIds = citations.data.map((x) => x.id)
const citationPre = []
const citationDict = {}
Expand Down

0 comments on commit 0e76a87

Please sign in to comment.