Skip to content

Commit

Permalink
extra config in all-caps
Browse files Browse the repository at this point in the history
  • Loading branch information
retorquere committed Oct 12, 2023
1 parent 3247209 commit 52ff0ae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions BibLaTeX.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ var revEprintIds = {
GoogleBooksID: 'googlebooks'
};

const extra = {
const EXTRA = { // fields picked up in structured key-value format in the same way as citeproc would
field: { // english-text label or CSL field => Zotero fields
'application number': ['applicationNumber'],
'archive id': ['archiveID'],
Expand Down Expand Up @@ -258,13 +258,13 @@ function parseExtraFields(item) {
if (kv) {
const label = kv[1].toLowerCase();
const value = kv[2];
for (const field of (extra.field[label] || [])) {
for (const field of (EXTRA.field[label] || [])) {
rec.field = label;
rec.value = value;
item[field] = item[field] || rec.value;
}

const creatorType = extra.creator[label];
const creatorType = EXTRA.creator[label];
if (creatorType) {
rec.field = label;

Expand Down
6 changes: 3 additions & 3 deletions BibTeX.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ function dateFieldsToDate(year, month, day) {
return false;
}

const extra = {
const EXTRA = { // fields picked up in structured key-value format in the same way as citeproc would
field: {
'application number': ['applicationNumber'],
'archive id': ['archiveID'],
Expand Down Expand Up @@ -334,13 +334,13 @@ function parseExtraFields(item) {
if (kv) {
const label = kv[1].toLowerCase();
const value = kv[2];
for (const field of (extra.field[label] || [])) {
for (const field of (EXTRA.field[label] || [])) {
rec.field = label;
rec.value = value;
item[field] = item[field] || rec.value;
}

const creatorType = extra.creator[label];
const creatorType = EXTRA.creator[label];
if (creatorType) {
rec.field = label;

Expand Down

0 comments on commit 52ff0ae

Please sign in to comment.