Buggy Cloze, exam in 4 days please help!

see image:

I have two clozes that should be blanks on the first card, but in the preview, you can see that only one is a blank and the other shows up as a bug.

Another example:

Things I have tried that didn’t work:
restarting anki, restarting mac (macbook pro 2022), updating anki to newest version

Things I have tried that “worked”
I deleted the entire cloze and typed it out {{c1:: xyz}}
I made multiple cloze1 in a single card by cntrl c and it worked in a new deck, but when I copied and pasted my cards to a new deck, same bugs showed up
no issue with other cards which were made at the same time and prior

Context: Last night I noticed this in the deck I was studying, I updated anki, made new cards, and bug showed up.

Please help, any feedback would be appreciated thanks!

This was using a different note type when it worked? Then you copy/pasted to create a different note. Was this new note using the same note type or you changed to a different cloze note type? Might be a note type issue, so you should try changing them.

1 Like

I only have one cloze note type, and it is the one that comes with anki with no addons. Thanks for responding!

Do I understand this correctly? You found a card that doesn’t work, deleted its content, re-typed the content and it worked? And only a few cloze cards are affected?

Can you do the following?:

  1. Tools → Check Database, just in case.
  2. On an affected card, click the < > button and show us the html. The button is next to the Text field.
2 Likes

Hey! Thank you so much for responding!

Yes, that is correct. The cloze stopped working, so I retyped the content within the cloze and the brackets. I also found out that deleting the bracket with content, and doing cntrl c works as well (shortcut).

Here is the html:

According to the picture the problem is most likely the existance of <span> where there shouldn’t be any.

It probably only works with <span> if the cloze is completely inside it, e.g. like this:

<span>{{c1::Hello}}</span>

So basically the html formatting is the issue and needs to be removed (I don’t know how to automatically do that).

It’s odd though that the formatting is there in the first place. If you pasted stuff from a webpage, make sure to paste without formatting (Ctrl+Shift+v). Doing that will prevent this issue for the future, but won’t solve the already affected cards.

1 Like

Have you tried the check database?

1 Like

Thank you so much for this!

I am not a coder at all but I am looking my other clozes that work and they don’t even have this span thing.

I have only been screenshotting images and with cntrl shift v. Can you go into more detail with not formatting cntrl shift v? Do I just right click and hit paste?

Thanks again!

Yes, they don’t need it. A <span> is basically just a group of stuff – but that’s not needed since everything is in a <div> anyway (basically a more universal group of stuff).

So you pasted everything with Ctrl+Shift+v? There shouldn’t be any html formatting then, really odd.

What I meant was it’s better to always use Ctrl+Shift+v instead of Ctrl+v, except if you know you want / need the formatting that you saw from webpages (like e.g. colors).

If you do not have too many affected cards, you could do the following:

  1. Select everything in the field with Ctrl+a.
  2. Cut it with Ctrl+x.
  3. Paste it without formatting with Ctrl+Shift+v.

Then verify if the html is gone and that it looks similar to your last picture:

(I think I remember Anki having custom paste logic, so let’s hope the steps above work)

1 Like

Thank you so so much for clarifying.

Okay, my mistake I realized I did paste using cntrl v instead of control shift v. So according to your final instructions, I should control a, and copy the field? delete, and then paste with cntrl shift v?

But one more thing, its weird because in my field, none of my cards are even pasted! I typed all those out…

Yes, that should remove formatting.

That’s certainly odd. But judging by your picture:

The html is very messy. It’s unlikely that you managed to do that with the toolbar (the thing where you can make text bold, italic, colored, ect). Typically this happens when one copy and pastes stuff from websites or other documents with formatting applied to them.

Maybe someone else has an idea how this is possible.

1 Like

Wow this is really helpful, I think moving forward I will have the html box open to make sure nothing weird is going on. Thank you so so so much, you are a life saver.

Many doctors use this app, and you just saved my life. You might even be a doctor. Thank you again, and thank you sorata you guys are the best!!!

2 Likes

also not sure if this might cause it, but sometimes I accidentally copy the stuff inside the cloze content since the short cut it pretty much similar to cntrl c.

That shouldn’t be able to create the kind of html we saw in the picture above though. If no html is copied, then none can be pasted (except, of course, there is some external app or an addon that modifies your clipboard buffer. But that program would be seriously buggy if it produced this kind of html. And this scenario is very unlikely).

I don’t think you need to worry about accidentally copying cloze content.

1 Like

got it thanks!!!

1 Like

There is no need to cut and paste, one can use the eraser button (removes all formatting). It takes care of your problems automatically.

2 Likes

I didn’t know that. You’re right, that’s much better than the separate steps I outlined above.

1 Like