Mechanism of clozes

Out of curiosity: How do clozes work?

Somehow Anki has to recognize the syntax of {{c1::text::hint}} and then display “text” and “hint” as needed, depending on the “definition” of the cloze, given via “c1”. A very similar syntax is also used with “closet for anki” (addon), does it work the same?

Background:

I tought myself some html, css and javascript for anki notetypes which sparked my interest in this topic. I’d like to myabe adopt this syntax to my own script eventually, if only for the sakes of getting better at coding. Therefore, any insights would be highly appreciated. :slight_smile:

Have a nice day!