Skip to content

Commit

Permalink
Merge pull request #12 from engeir/master
Browse files Browse the repository at this point in the history
fix(extract_citekeys): match against apastyle prenotes
  • Loading branch information
jwcarr authored Jun 13, 2024
2 parents be49f1a + 7f7ea15 commit df2b9e1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bibfish/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit df2b9e1

Please sign in to comment.