Skip to content

Commit f9978bc

Browse files
committed
Fixed pages having leading/trailing whitespace, with test
1 parent e31d3bb commit f9978bc

File tree

3 files changed

+472
-1
lines changed

3 files changed

+472
-1
lines changed

paperqa/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ def merge_bibtex_entries(entry1: Entry, entry2: Entry) -> Entry:
618618
def misc_string_cleaning(data: dict[str, Any]) -> dict[str, Any]:
619619
"""Clean strings before the enter the validation process."""
620620
if pages := data.get("pages"):
621-
data["pages"] = pages.replace("--", "-").replace(" ", "")
621+
data["pages"] = pages.replace("--", "-").replace(" ", "").strip()
622622
return data
623623

624624
@staticmethod

0 commit comments

Comments
 (0)