From 7f7ea15b5a61ba3a6943308750374a9706694fef Mon Sep 17 00:00:00 2001 From: engeir Date: Tue, 11 Jun 2024 15:35:22 +0200 Subject: [PATCH] fix(extract_citekeys): match against apastyle prenotes --- bibfish/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bibfish/__init__.py b/bibfish/__init__.py index 18e2b64..09d7182 100644 --- a/bibfish/__init__.py +++ b/bibfish/__init__.py @@ -41,10 +41,11 @@ def extract_citekeys(manuscript_file: str, cite_commands: list) -> list: except FileNotFoundError: pass citations = re.findall( - r"\\(" + "|".join(cite_commands) + r")(\[.+?\])?.*?\{(.*?)\}", manuscript + r"\\(" + "|".join(cite_commands) + r")(<.+?>)?.*?(\[.+?\])?.*?\{(.*?)\}", + manuscript, ) for citation in citations: - for key in citation[2].replace(" ", "").split(","): + for key in citation[3].replace(" ", "").split(","): if key: citekeys.append(key) return list(set(citekeys))