Skip to content

Commit

Permalink
chore(bibtex): add type hint
Browse files Browse the repository at this point in the history
  • Loading branch information
5j9 committed Aug 4, 2024
1 parent 35a88df commit e872e40
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/bibtex.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def search_for_tag(bibtex: str) -> dict:
return {f[0].lower(): f[1] if f[1] else f[2] for f in fs}


def parse(bibtex):
def parse(bibtex) -> dict:
"""Parse bibtex string and return a dictionary of information."""
bibtex = special_sequence_cleanup(bibtex)
g = (d := search_for_tag(bibtex)).get
Expand Down Expand Up @@ -62,7 +62,7 @@ def parse(bibtex):
return d


def special_sequence_cleanup(bibtex):
def special_sequence_cleanup(bibtex) -> str:
"""Replace common TeX special symbol commands with their unicode value."""
return WORDS_IN_BRACES_SUB(
r'\g<1>',
Expand Down

0 comments on commit e872e40

Please sign in to comment.