reuseman / flashcards-obsidian

🎴 An Anki plugin for Obsidian.md
MIT License
897 stars 87 forks source link

bugfix: Spaced Card model not generating properly #58

Closed rajatarora closed 2 years ago

rajatarora commented 2 years ago

Fixed a small bug due to which createModels API call for spaced cards was returning an error:

{
    "result": null,
    "error": "Card template ⁨1⁩ in notetype '⁨Obsidian-spaced⁩' has a problem.<br>See the preview for more information."
}

The issue is with the Source field, which was being inserted in the template for spaced cards even if Source Support is not enabled in settings.

Replaced ${sourceField} with ${sourceFieldContent} in anki.ts where the templates for spaced cards are defined. Tested, works fine for me :)