ObsidianToAnki / Obsidian_to_Anki

Script to add flashcards from text/markdown files to Anki
GNU General Public License v3.0
1.54k stars 136 forks source link

Image Width Syntax Misinterpreted as Alt Text #624

Open dmantula opened 4 days ago

dmantula commented 4 days ago

Background

In Obsidian, images can have their width set using a shorthand syntax:

![[image.png|250]]

Issue

The plugin currently misinterprets this syntax when converting to Anki. Instead of setting the width, it treats the value intended as the width (250 in this example) as the alt text. As a result, the converted Anki card contains the following HTML:

<img src="image.png" alt="250">

The plugin should interpret the value as the image width, resulting in the following HTML:

<img src="image.png" width="250">