Skip to content

Commit

Permalink
🐛 Duplicate bibtex entries when uppercase (#842)
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanc1 authored Jan 11, 2024
1 parent d2e6e78 commit 860c297
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/cuddly-coats-joke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'myst-cli': patch
---

Bibtex with capital ARTICLE now no longer duplicates all entries
4 changes: 2 additions & 2 deletions packages/myst-cli/src/build/utils/bibtex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import type { References } from 'myst-common';
*
* Look for the pattern '@article{key' then finds the closing bracket
* and returns that substring. The "article" prefix may be any
* lowercase alpha word.
* alpha word.
*/
export function extractBibtex(key: string, bibtex: string) {
const match = bibtex.match(new RegExp(`@[a-z]*{${key}`, 'g'));
const match = bibtex.match(new RegExp(`@[a-zA-Z]*{${key}`, 'g'));
if (!match) return;
const start = bibtex.indexOf(match[0]);
let bracketCount = 0;
Expand Down

0 comments on commit 860c297

Please sign in to comment.