Closed RichardEb closed 4 years ago
Hi, thanks for the report :slightly_smiling_face:. I haven't implemented this yet, but it has been on my radar for a while (see #56). I'm looking into replacing the parser altogether which would make things like this much easier, but I still have to figure out what method would be best for that. I'll see if I can make a temporary patch for the current parser soon.
I counted at least four BibTeX parsing modules at npmjs, wouldn't it make more sense to join forces with one of them instead of managing another parser?
Citation.js is quite the best. I also rely on the structure of the generated (json) object
@nichtich You could always insert a different parser with the plugins API:
let Cite = require('citation-js')
let {parse} = require('astrocite-bibtex')
Cite.plugins.input.addDataParser('@bibtex/text', {parser: parse})
Cite('...').data
Quick update: I'm working on a new parser with better performance and support for @string
, among other things. I don't have an ETA, since I don't know if I want to bundle this update with the BibTeX mappings update, that depends on how fast things move along. EDIT: code at https://github.com/citation-js/bibtex-parser-experiments/tree/master/src/idea-reworked, you could probably use it already like I showed for astrocite above.
This has been released in v0.5.0-alpha.3
. I'll close this issue for now.
citation.js can't parse Bibtext: @STRING . Here is an example code:
This will throw rhis error:
Ref: http://www.bibtex.org/Format/