Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(parsing) cloze, code #19

Merged
merged 17 commits into from
Sep 17, 2024
4 changes: 2 additions & 2 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def process_file(
for card in parsed_cards:
text = card.text

if not re.match(r"{{c\d+::", text):
unclozed_cards.append(card)
if not re.search(r"\{\{c\d+::", text):
unclozed_cards.append((text, card.extra))
continue

if card.tags and len(card.tags) > 0:
Expand Down
2 changes: 1 addition & 1 deletion src/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def md_to_html(raw_string: str) -> str:
],
)

return s.replace("\n", "")
return s.strip("\n")


def process_field(
Expand Down