Skip to content

Commit 73c5747

Browse files
committed
feat: adjust card print output
1 parent f74a396 commit 73c5747

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/apyanki/anki.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from typing import TYPE_CHECKING, Any
1515

1616
from click import Abort
17+
from rich.markdown import Markdown
1718
from rich.progress import Progress, SpinnerColumn, TextColumn
1819
from rich.table import Table
1920
from rich.text import Text
@@ -449,9 +450,9 @@ def list_cards_as_table(self, query: str, opts_display: dict[str, bool]) -> None
449450
card, one_line=True, max_width=width
450451
)
451452

452-
row: list[str | Text] = [question]
453+
row: list[str | Text | Markdown] = [Markdown(question)]
453454
if opts_display.get("show_answer", False):
454-
row += [answer]
455+
row += [Markdown(answer)]
455456
if opts_display.get("show_cid", False):
456457
row += [str(card.id)]
457458
if opts_display.get("show_due", False):

src/apyanki/cards.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def card_fields_as_md(
5959

6060

6161
def _field_to_md(field: str, one_line: bool = False, max_width: int = 0) -> str:
62-
prepared_field: str = to_md(field).replace("\n\n", "\n")
62+
prepared_field: str = to_md(field)
6363

6464
if one_line:
6565
prepared_field = prepared_field.replace("\n", " ")

0 commit comments

Comments
 (0)