Skip to content

Commit

Permalink
fixes #3040
Browse files Browse the repository at this point in the history
  • Loading branch information
retorquere committed Nov 1, 2024
1 parent 43386e0 commit c39e3e6
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 1 deletion.
1 change: 1 addition & 0 deletions test/features/export.feature
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Feature: Export

Examples:
| file | references |
| Duplicate note is not correctly commented out in biblatex output #3040 | 1 |
| citekey not skip one-letter word #3021 | 1 |
| charmapcsv mapping not working anymore #3020 | 1 |
| Use nonacademic entrysubtype in place of newspapermagazine for biblatex-apa #2987 | 1 |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@book{McDougallTJ.Barker-delete-me,
title = {Getting started with {{TEOS-10}} and the {{Gibbs Seawater}} ({{GSW}}) {{Oceanographic Toolbox}}},
author = {McDougall, Trevor J and Barker, Paul M},
date = {2011},
publisher = {Trevor J McDougall},
location = {Battery Point, Tasmania, Australia},
url = {https://www.teos-10.org/pubs/Getting_Started.pdf},
isbn = {978-0-646-55621-5},
language = {English},
annotation = {OCLC: 724024071},
note = {OCLC: 724024071}
}
% == BibLateX quality report for McDougallTJ.Barker-delete-me:
% ? unused Library catalog ("Open WorldCat")
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"config": {
"id": "36a3b0b5-bad0-4a04-b79b-441c7cef77db",
"label": "BetterBibTeX JSON",
"preferences": {
"asciiBibLaTeX": true,
"autoAbbrev": true,
"autoExportDelay": 8,
"baseAttachmentPath": "/Users/furue/Dropbox/doc/papers",
"bibtexURL": "url",
"citekeyFormat": "authEtal2(initials=true).capitalize+\":\"+year",
"exportTitleCase": false,
"extraMergeCSL": true,
"language": "language",
"postscript": "if (Translator.BetterTeX) {\n if (item.extra) reference.add({ name: 'note', value: item.extra.replace(/(https?:\\/\\/[^ ]+)/, \"<script>\\\\url{$1}</script>\") })\n}",
"qualityReport": true,
"skipFields": "abstract,file,issn",
"strings": "@string{AO\t= \"Atmos.\\ Ocean\"}\n@string{ARFM\t= \"Annu.\\ Rev.\\ Fluid Mech.\"}\n@string{BAMS\t= \"Bull.\\ Amer.\\ Meteor.\\ Soc.\"}\n@string{BullMarSci = \"Bulletin of Marine Science\"}\n@string{CD\t= \"Climate Dynamics\"}\n@string{CSR\t= \"Cont.~Shelf Res.\"}\n@string{DAO\t= \"Dyn.\\ Atmos.\\ Oceans.\"}\n@string{DSR\t= \"Deep Sea Res.\"}\n@string{DSR1\t= \"Deep Sea Res.~I\"}\n@string{DSR2\t= \"Deep Sea Res.~II\"}\n@string{DSRA\t= \"Deep Sea Res.\\ Part~A\"}\n@string{FMARS\t= \"Front.\\ Mar.\\ Sci.\"}\n@string{GAFD\t= \"Geophys.\\ Astrophys.\\ Fluid Dyn.\"}\n@string{GBC\t= \"Global Biogeochem.\\ Cycles\"}\n@string{GRL\t= \"Geophys.\\ Res.\\ Lett.\"}\n@string{JAOT\t= \"J.\\ Atmos.\\ Oceanic Technol.\"}\n@string{JAS\t= \"J.\\ Atmos.\\ Sci.\"}\n@string{JC\t= \"J.\\ Climate\"}\n@string{JCP\t= \"J.\\ Comput.\\ Phys.\"}\n@string{JFM\t= \"J.\\ Fluid Mech.\"}\n@string{JGR\t= \"J.\\ Geophys.\\ Res.\"}\n@string{JGRC\t= \"J.\\ Geophys.\\ Res.\\ Oceans\"}\n@string{JMR\t= \"J.\\ Mar.\\ Res.\"}\n@string{JMSJ\t= \"J.\\ Meteorol.\\ Soc.\\ Japan\"}\n@string{JPlanktonRes = \"Journal of Plankton Research\"}\n@string{JPO\t= \"J.\\ Phys.\\ Oceanogr.\"}\n@string{JO\t= \"J.\\ Oceanogr.\"}\n@string{JOO = \"J. Oper.\\ Oceanogr.\"}\n@string{JOSJ\t= \"J.\\ Oceanogr.\\ Soc.\\ Japan\"}\n@string{MWR\t= \"Mon.\\ Wea.\\ Rev.\"}\n@string{OD\t= \"Ocean Dyn.\"}\n@string{OM\t= \"Ocean Modelling\"}\n@string{PF\t= \"Phys.\\ Fluids\"}\n@string{PhysRevLett = \"Phys.\\ Rev.\\ Lett.\"}\n@string{PO\t= \"Prog.\\ Oceanog.\"}\n@string{PRS\t= \"Proc.\\ Roy.\\ Soc., Ser.~A\"}\n@string{QJRMS\t= \"Quarterly J.\\ Roy.\\ Meteorol.\\ Soc.\"}\n@string{RG\t= \"Rev.\\ Geophys.\"}\n@string{RevGeophysSpacePhys = \"Rev.\\ Geophys.\\ Space Phys.\"}\n@string{SREP = \"Scientific Reports\"}",
"verbatimFields": "url,doi,file,eprint,verba,verbb,verbc,groups"
}
},
"items": [
{
"ISBN": "978-0-646-55621-5",
"citationKey": "McDougallTJ.Barker-delete-me",
"creators": [
{
"creatorType": "author",
"firstName": "Trevor J",
"lastName": "McDougall"
},
{
"creatorType": "author",
"firstName": "Paul M",
"lastName": "Barker"
}
],
"date": "2011",
"extra": [
"OCLC: 724024071",
"Citation Key: McDougallTJ.Barker-delete-me"
],
"itemID": 1,
"itemType": "book",
"language": "English",
"libraryCatalog": "Open WorldCat",
"place": "Battery Point, Tasmania, Australia",
"publisher": "Trevor J McDougall",
"title": "Getting started with TEOS-10 and the Gibbs Seawater (GSW) Oceanographic Toolbox",
"url": "https://www.teos-10.org/pubs/Getting_Started.pdf"
}
]
}
5 changes: 4 additions & 1 deletion translators/bibtex/entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,10 @@ export class Entry {
v_old = v_old.toLowerCase()
v_new = v_new.toLowerCase()
}
if (v_old !== v_new) this.quality_report.push(`duplicate "${ field.name }" ("${ this.has[field.name].value }") ignored`)
if (v_old !== v_new) {
if (typeof v_old === 'string') v_old = v_old.replace(/[\r\n]+/g, ' ')
this.quality_report.push(`duplicate "${ field.name }" ("${ v_old }") ignored`)
}
}

delete this.has[field.name]
Expand Down

0 comments on commit c39e3e6

Please sign in to comment.