Skip to content

Commit

Permalink
Add images to top of field to match AnkiPro
Browse files Browse the repository at this point in the history
  • Loading branch information
abdnh committed Nov 5, 2023
1 parent 99689cc commit 22a76be
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/importers/ankipro.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,13 @@ def _import_cards(self) -> int:
media_refs_map[id] = fname_to_link(filename)

for i, side in enumerate(("front_side", "back_side")):
contents = note_dict["fields"][side]
contents = ""
media_ids = media_side_map.get(side, [])
if media_ids:
contents += "<br>" + "<br>".join(
contents += "<br>".join(
media_refs_map[id] for id in media_ids
)
contents += note_dict["fields"][side]
note.fields[i] = contents
self.mw.col.add_note(note, deck.anki_id)
count += 1
Expand Down

0 comments on commit 22a76be

Please sign in to comment.