Skip to content

Commit 30f8166

Browse files
author
Colin Leong
committed
CDL: edited citation-extraction as requested
1 parent ffe8da4 commit 30f8166

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/find_bare_citations.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212

1313

1414
def extract_citation_keys(bib_file_path):
15-
citation_keys = []
16-
with open(bib_file_path, "r") as file:
17-
for line in file:
18-
match = re.match(r"@\w+\{([^,]+),", line)
19-
if match:
20-
citation_keys.append(match.group(1))
15+
content = bib_file_path.read_text()
16+
# with open(bib_file_path, "r") as file:
17+
# for line in file:
18+
citation_keys = re.findall(r"@\w+\{([^,]+),", content)
19+
# if match:
20+
# citation_keys.append(match.group(1))
2121
return citation_keys
2222

2323
def find_bare_citations(markdown_file_path: Path, citation_keys: list) -> list:

0 commit comments

Comments
 (0)