Depending on where you put cloze markers, you can end up creating invalid HTML. e.g.
<div>foo{{c1::</div>}}
will result in an opened div without it being closed again. Fixing this is not trivial, as we’ll need to operate on the DOM instead of doing simple text insertion.