Skip to content

Commit

Permalink
fixes #2816
Browse files Browse the repository at this point in the history
  • Loading branch information
retorquere committed Mar 16, 2024
1 parent 2bc2d6a commit 679d127
Show file tree
Hide file tree
Showing 5 changed files with 126 additions and 2 deletions.
1 change: 1 addition & 0 deletions test/features/export.feature
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ Feature: Export

Examples:
| file | references |
| Better BibTeX export from Zotero missing Extra fields eg issued #2816 | 1 |
| formula grouping | 1 |
| formula grouping-upgrade | 1 |
| BBT does not escape # in first argument of href in note #2617 | 2 |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
@book{rafn1829,
title = {{Fornaldar s{\"o}gur Nordrlanda eptir g{\"o}mlum handritum}},
editor = {Rafn, Carl Christian},
year = {1829/1830},
publisher = {Popp},
address = {Copenhagen},
langid = {danish},
note = {vol I:
\par
1. Hr{\'o}lfs saga kraka
\par
2. Bjarkam{\'a}l
\par
3. V{\"o}lsunga saga
\par
4. Ragnars saga
\par
5. Kr{\'a}kum{\'a}l
\par
6. Norna Gests {\th}{\'a}ttr
\par
7. Ragnarsona {\th}{\'a}ttr
\par
8. S{\"o}gubrot
\par
9. S{\"o}rla {\th}{\'a}ttr
\par
10. Hervarar saga
\par
vol II: \\
1. Fr{\'a} Fornjoti ok hans {\ae}ttm{\"o}nnum,
\par
2. H{\'a}lfs saga ok H{\'a}lfsreka (23-60),
\par
3. Fri{\dh}{\th}jofs saga ens fr{\ae}kna (61-100),
\par
4. Af Upplendinga konungum (101-106),
\par
5. Ketils saga h{\ae}ngs (107-139),
\par
6. Gr{\'i}ms saga lo{\dh}inkinna (141-157),
\par
7, {\"O}rvar-Odds saga (159-322),
\par
8. Ans saga Bogsveigis (323-362),
\par
9. Hr{\'o}mundar saga (363-380),
\par
10. {\TH}orsteins saga vikingssonar (381-459),
\par
11. Asmundar saga kappabana (461-487)
\par
vol. III
\par
1. Gautreks saga [sem sumir kalla Gjafa-Refs s{\"o}gu]
\par
2. Hr{\'o}lfs saga Gautrekssonar
\par
3. B{\'o}sa saga
\par
4. S{\"o}gu-Hr{\'o}lfs saga
\par
5. Egils saga einhenda
\par
6. S{\"o}rla saga sterka
\par
7. Hj{\'a}lers saga og Olvers
\par
8. H{\'a}lfdanae saga Eysteinnsonar
\par
9. H{\'a}lfdanar saga Br{\"o}nuf{\'o}stra
\par
10. Sturlaugs saga startama
\par
11. Illuga saga}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"config": {
"id": "36a3b0b5-bad0-4a04-b79b-441c7cef77db",
"label": "BetterBibTeX JSON",
"options": {
"Items": true,
"Preferences": true,
"exportNotes": true,
"worker": true
},
"preferences": {
"DOIandURL": "doi",
"autoAbbrevStyle": "http://www.zotero.org/styles/cell",
"autoExportDelay": 2,
"citekeyFormat": "auth.lower+year"
}
},
"items": [
{
"citationKey": "rafn1829",
"creators": [
{
"creatorType": "editor",
"firstName": "Carl Christian",
"lastName": "Rafn"
}
],
"date": "1829\u20131830",
"extra": [
"bibtex: rafn1829",
"Issued: 1829/1830"
],
"itemID": 1,
"itemType": "book",
"language": "da",
"notes": [
"<p>vol I:</p>\n<p>1. Hr\u00f3lfs saga kraka</p>\n<p>2. Bjarkam\u00e1l</p>\n<p>3. V\u00f6lsunga saga</p>\n<p>4. Ragnars saga</p>\n<p>5. Kr\u00e1kum\u00e1l</p>\n<p>6. Norna Gests \u00fe\u00e1ttr</p>\n<p>7. Ragnarsona \u00fe\u00e1ttr</p>\n<p>8. S\u00f6gubrot</p>\n<p>9. S\u00f6rla \u00fe\u00e1ttr</p>\n<p>10. Hervarar saga</p>",
"<p>vol II: <br />1. Fr\u00e1 Fornjoti ok hans \u00e6ttm\u00f6nnum,</p>\n<p>2. H\u00e1lfs saga ok H\u00e1lfsreka (23-60),</p>\n<p>3. Fri\u00f0\u00fejofs saga ens fr\u00e6kna (61-100),</p>\n<p>4. Af Upplendinga konungum (101-106),</p>\n<p>5. Ketils saga h\u00e6ngs (107-139),</p>\n<p>6. Gr\u00edms saga lo\u00f0inkinna (141-157),</p>\n<p>7, \u00d6rvar-Odds saga (159-322),</p>\n<p>8. Ans saga Bogsveigis (323-362),</p>\n<p>9. Hr\u00f3mundar saga (363-380),</p>\n<p>10. \u00deorsteins saga vikingssonar (381-459),</p>\n<p>11. Asmundar saga kappabana (461-487)</p>",
"<p>vol. III</p>\n<p>1. Gautreks saga [sem sumir kalla Gjafa-Refs s\u00f6gu]</p>\n<p>2. Hr\u00f3lfs saga Gautrekssonar</p>\n<p>3. B\u00f3sa saga</p>\n<p>4. S\u00f6gu-Hr\u00f3lfs saga</p>\n<p>5. Egils saga einhenda</p>\n<p>6. S\u00f6rla saga sterka</p>\n<p>7. Hj\u00e1lers saga og Olvers</p>\n<p>8. H\u00e1lfdanae saga Eysteinnsonar</p>\n<p>9. H\u00e1lfdanar saga Br\u00f6nuf\u00f3stra</p>\n<p>10. Sturlaugs saga startama</p>\n<p>11. Illuga saga</p>"
],
"numberOfVolumes": "3",
"place": "Copenhagen",
"publisher": "Popp",
"title": "Fornaldar s\u00f6gur Nordrlanda eptir g\u00f6mlum handritum"
}
]
}
3 changes: 1 addition & 2 deletions translators/bibtex/bibtex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,7 @@ export function generateBibTeX(translation: Translation): void {
break

case 'interval':
if (ref.date.from.month) ref.add({ name: 'month', value: months[ref.date.from.month - 1], bare: true })
ref.add({ name: 'year', value: `${ref.date.from.year}` })
ref.add({ name: 'year', value: item.date })
break

case 'date':
Expand Down
1 change: 1 addition & 0 deletions translators/bibtex/entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ export class Entry {
}

this.extraFields = JSON.parse(JSON.stringify(item.extraFields))
log.debug('extra-fields:', this.extraFields)

// should be const entrytype: string | { type: string, subtype?: string }
// https://github.com/Microsoft/TypeScript/issues/10422
Expand Down

0 comments on commit 679d127

Please sign in to comment.