Clone and edit this document
Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
Capitalized BibTeX fields not reading correctly
node v10.24.1
version:
1.0.0
endpoint
share
tweet
From https://github.com/larsgw/citation.js/issues/198
const Cite = require('citation-js@0.5.0-alpha.5') Cite.plugins.input.addDataParser('@bibtex/object', { async: false, parser (data) { for (const prop in data.properties) { data.properties[prop.toLowerCase()] = data.properties[prop] delete data.properties[prop] } return Cite.parse.bibtex.json(data) } }) const bibfile = `@article{Thirumalai2017, Author = {D. Thirumalai and Guang Shi}, Date-Added = {2020-05-25 16:29:18 -0500}, Date-Modified = {2020-05-25 16:29:18 -0500}, Doi = {10.1016/j.bpj.2016.11.902}, Journal = {Biophysical Journal}, Month = feb, Number = {3}, Pages = {411--412}, Publisher = {Elsevier {BV}}, Title = {Chromatin Is Stretched but Intact When the Nucleus Is Squeezed through Constrictions}, Url = {https://doi.org/10.1016/j.bpj.2016.11.902}, Volume = {112}, Year = {2017}, Bdsk-Url-1 = {https://doi.org/10.1016/j.bpj.2016.11.902}}` let citations = new Cite(bibfile) citations.data[0]
Loading…
no comments
sign in
to comment