reuseman / flashcards-obsidian

🎴 An Anki plugin for Obsidian.md
MIT License
872 stars 86 forks source link

Embed audios in the sub directory are not working #160

Open timgreen opened 1 year ago

timgreen commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce

Expected behavior The media copied from Obsidian to Anki should keep the same relative structure. Or update the path for embed when insert embed into Anki cards.

Screenshots image

Markdown used

## continue #card-reverse
![[./tts/continue.mp3]]
(*verb*)
- **Definition:** to keep doing something
- **Sentence:** Min `___` to think about what it would be like to live on the moon.
github-actions[bot] commented 1 year ago

Thank you for taking the time to report the issue and help me to make the project better! 🙂

timgreen commented 1 year ago

According to https://docs.ankiweb.net/importing.html#importing-media

Do not put subdirectories in the media folder, or some features will not work.

So the correct behavior might be

wawa-dan commented 1 year ago

Same topic than #150 #153, all can be grouped togeter. And I found this description really more clear, thanks @timgreen

I guess that best is to rename the media path to replace folder/filename by something as folder#filename if it's work. What I wonder is that we could have some conflit on media at a point of time, if the media name already exist. But it's another topic. @reuseman what do you think ?

timgreen commented 1 year ago

PS: In @anki.md I choose to rename the media filenames.

https://github.com/timgreen/Anki.md/blob/290fa22c1373ae404d16bbf71e71bb5c5875fd2e/packages/core/src/parser.ts#L71