With Closet, this would definitely be possible. With native Anki clozes, only if we write our own cloze parser (which I didn’t get around to yet).
Anki converts native clozes into HTML before template scripts can access them. Clozes that don’t belong to the current card are just converted to plain text. On the front side of card 1 there’s no way of telling what’s clozed out on card 2. We need to know this for overlapping clozes though.
Why is Closet different?
<span> elements, which I can query.
My own note type (using Closet) achieves overlapping cloze functionality with lists and a special command field telling it how many clozes should be shown before and after the current cloze. This allows me to tweak this behaviour individually per note.
Examples for this syntax:
(Field content in brackets)
[1 ] → one before, one after
[2 ] → two before, two after
[* ] → all before, all after
[ ] → none before, none after
[1, 0] → one before, none after
[*, 0] → all before, none after
[0, 1] → none before, one after
[0, *] → none before, all after
[1, 2] → one before, two after
I’ll try to find time for this in the coming weeks. Sadly, I’m pretty busy with uni currently (got more time for such stuff in the summer).