When I was trying to write a new card template I have encountered a strange behaviour.
The setup:
- I’m in
Card Types for [Deck]window. - I have a card type selected
- The code in
Front TemplateandBack Templateis as below.
The path:
- I click the
Flipbutton
Effect:
Some code disappears, some parts get switched between the Front and the Back template. The preview gets mangled, but it follows the changes it code at least. The results of the aforementioned scrambling can be found below the code for Front Template and Back Template code.
Original code:
Front Template:
[anki:tts lang=zh_CN]{{Simplified}}[/anki:tts]
[anki:tts lang=zh_CN]{{Simplified sentence}}[/anki:tts]
Back Template:
{{FrontSide}}
<br/>
<div style='font-family: "Arial"; font-size: 30px; color: gold'>
<b>{{Simplified}}</b>
</div>
</br>
<div style='font-family: "Liberation Sans"; font-size: 23px;'>
{{Simplified sentence}}
</div>
<hr id=answer>
<div style='font-family: "Liberation Sans"; font-size: 30px; padding: 5px'>{{Meaning}} </div>
<div style='font-family: "Liberation Sans"; font-size: 20px;'>{{Sentence translation}}</div>
<ruby>有<rt>you</rt></ruby>
<script>
</script>
After clicking once Flip:
(starting with Front Template selected)
Front Template:
<div style='font-family: "Liberation Sans"; font-size: 30px; padding: 5px'>{{Meaning}} </div>
<div style='font-family: "Liberation Sans"; font-size: 20px;'>{{Sentence translation}}</div>
<ruby>有<rt>you</rt></ruby>
<script>
</script>
Back Template:
{{FrontSide}}
<hr id=answer>
[anki:tts lang=zh_CN]{{Simplified}}[/anki:tts]
[anki:tts lang=zh_CN]{{Simplified sentence}}[/anki:tts]
Quick notes
I’ve tried looking in the documentation for what the button is supposed to be doing but I’ve found nothing (not that I’ve searched all that hard) but, as you might have noticed, after pushing the button the following had simply disappeared:
<br/>
<div style='font-family: "Arial"; font-size: 30px; color: gold'>
<b>{{Simplified}}</b>
</div>
</br>
<div style='font-family: "Liberation Sans"; font-size: 23px;'>
{{Simplified sentence}}
</div>
I don’t think that’s what should be happening.
My anki version is 25.02.5 so this bug (if it’s even a bug might have been solved already), I’ve tried upgrading but I’m running Ubuntu 22.04 and upgrading to the newest version makes anki cry about glib or smth. :<