jasonwilliams / anki

Anki VSCode Plugin
MIT License
278 stars 32 forks source link

Images are in markdown do not show in Anki app #100

Open rleyvasal opened 1 year ago

rleyvasal commented 1 year ago

Image entered in markdown does not appear in Anki app after entering code below.

The card and Cloze are showing correctly but the image does not show in Anki app.

![image](/home/rls/Downloads/anki_md/2x2.png)

Note: I have also tried:

![image](./2x2.png)

anki_w_image

anki_w_image_2

jasonwilliams commented 1 year ago

Could you create a test case repo for us to look at? Thanks

rleyvasal commented 1 year ago

how to do a test case repo?

jasonwilliams commented 1 year ago

The screenshot you have put that in a repo and write steps for me to see the same issue

rleyvasal commented 1 year ago

https://github.com/rleyvasal/vscode_anki_repo/blob/main/README.md

.md file and image is located in the repo,

Anki for VSCode version: Last updated 2/12/2023, 12:31:32

Anki version: Version ⁨2.1.57 (6b7d372c)⁩ Python 3.9.15 Qt 6.4.2 PyQt 6.4.0

OS Version: Ubuntu 22.04

jasonwilliams commented 1 year ago

I have a feeling this may be because you're using absolute paths. Could you try doing the same with a relative path from the markdown file?

Issue here: https://github.com/jasonwilliams/anki/blob/main/src/markdown/Serializer.ts#L139-L140

rleyvasal commented 1 year ago

Absolute and relative paths both work.

The issue happens only when Cloze is used.

This doesn't show the image

## 2 x 2 =  {{c1::4}}

![](2x2.png)

This shows the image

## 3 x 3 = 9

![](2x2.png)

Note: Adding image with Cloze, works in the Anki app anki_image_w_cloze