Closed Senth closed 11 years ago
For whatever reason, Anki calls the mungefields hook twice per card; in the first run the lilypond plugin replaces a e c with <img src=...>
, in the second run it replaces <img src=...>
with None/empty string (because it filters HTML codes put in by Anki such as <p>
or <br>
).
And for some reason the empty string ends up getting rendered as the previously generated image the first time, and afterwards lilypond just reuses the previously cached image (which is always the image for None).
It doesn't happen for [lilypond] tags because the second time around those are already replaced with <img src=...>
which does not match the regexp that looks for [lilypond] anymore. So it's left alone in the 2nd mungeFields call.
Thanks for your report - I'll fix it as soon as I find out how.
Hopefully fixed. Please update the plugin and let me know if it works for you.
Works, thanks :)
Although the ability to add/remove templates disappeared from the lilypond menu, was this intentional? Hmm, if I changed the name of the plugin from LilyPond_Integration_Sheet_Music_Typesetter to just lilypond I could see the template menu again.
No, that's not intentional. It appears the addon site changed the filename for some reason. Delete that and try redownloading the addon again please?
Works now :)
Great. I'll have to remember to upload it as .zip instead of .py in the future.
Closing...
Hi, found a bug when using a whole field as lilypond
Using Anki 2.0-r6
How to reproduce
What should happen
The card displays "e".
What actually happens
It still displays "a e c" and displays "a e c" for every flashcard created.