jcklie / anki-maobi

máobĭ (毛笔) is an Anki add-on to create cards with writing quizzes for Hanzi (Chinese characters)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Expected a single character, but was '(Hanzi)'!

lollylan opened this issue · comments

Tried adding the addon and using it in my cards, but after adding the required line
<div id="character-target-div"></div>
I always get shown

Maobi encountered an error: Expected a single character, but was '(Hanzi)'!

I have a field called Hanzi with the hanzi in it. Tried creating fresh decks, copying the cards from the sample desk etc. Any ideas what might cause that?

That happens normally only if the Hanzi field contains more than one character, as this addon only supports single characters right now. What is in your Hanzi field when it gives you this error?

This happens on completely empty decks as well and so far none of the decks I tried creating usind maobi had words with more than 1 character (also checked for spaces)

Can you send me a deck which triggers this error and tell me which version of maobi you are using? You can see it by going to Tools -> Addons -> maobi -> View Files -> __version__.py. You can either attach it here or send it to git@mrklie.com. Thank you!

Your deck works for me. Can you also send me your maobi config Tools -> Addons -> maobi -> Config?

{ "decks": [ { "deck": "Maobi", "enabled": true, "field": "Hanzi", "grid": "rice", "leniency": 100, "size": 200, "template": "Recognition" } ] }

This is all it says, didn't play around in there at all ;)

This is really strange, I cannot reproduce it from your files. Can you make me a screenshot like this? You can see that it works for me once the Hanzi contains only a single character.

image

But once there is one character more, then it breaks

image

Which operating system and Anki version are you using?

I Use WIndows 10 and Anki 2.1.14
I really do not know how, but for some reason it works now. I didn't do anything and it just worked O.o Thank you very much though!