Escaping double colon "::" in cloze deletion cards

Hello there :slight_smile:

i was wondering, if there is a recommended way of escaping a double colon (β€œ::”) when used in a cloze deletion card as the actual text to be clozed.

My use case for this is a couple of cards i want to make for the Backus-Naur Form, which uses β€œ::=” as a part of the syntax.

My preliminary solution has been to use the html <span> element between the two colons, which then looks something like this:

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

This does seem to work, but it feels a bit like a hacky solution.

Is there a better way of doing this?

Cheers!

There’s no escape character, but you could try a zero width space as a more compact workaround.

1 Like

Thanks for the suggestion!

Putting a zero width space between the colons does indeed seem to work for the standard cloze deletion cards.

I should have mentioned that i also want to make a second cloze deletion card type, where i’m prompted to type in the correct answer.

When comparing the given answer with the enclozed text, Anki recognizes the zero width space as a character and marks the given answer as wrong, if you don’t type a space between the colons.

You could obviously just ignore this β€œfalse negative”, but its not ideal. So in this respect it seems like the <span> element is the better solution.