I’m guessing you want something like this:
This is for the bare Cloze syntax. The syntax I used is:
%YAML 1.2
---
name: Cloze
file_extensions: [cloze]
scope: text.cloze
variables:
Identifier: '[[:alpha:]][[:alpha:]_]*'
contexts:
main:
- match: \{
scope: punctuation.section.braces.begin.cloze
push:
- meta_scope: meta.question.cloze
- match: \}
scope: punctuation.section.braces.end.cloze
pop: true
- match: (\%)(\d+)(\%)
captures:
1: variable.language.cloze
2: constant.numeric.cloze
3: variable.language.cloze
- match: (\d+)?(:)({{Identifier}})(:)
captures:
1: constant.numeric.cloze
2: punctuation.separator.cloze
3: entity.other.attribute-name.cloze
4: punctuation.separator.cloze
- match: \#
scope: punctuation.definition.comment.cloze
push:
- meta_scope: comment.block.cloze
- match: (?=[=~}])
pop: true
- match: \~
scope: punctuation.separator.cloze
- match: =
scope: keyword.operator.assignment.cloze
Save this in Packages/User/Cloze.sublime-syntax
Now to embed this into XML, the easiest hack is to use the with_prototype
trick:
%YAML 1.2
---
name: XML (Cloze)
scope: text.xml
file_extensions: [cloze, xml]
contexts:
main:
- match: ""
push: scope:text.xml
with_prototype:
- match: '<!\[CDATA\['
scope: punctuation.definition.string.begin.xml
push:
- meta_scope: meta.group.cloze
- match: ']]>'
scope: punctuation.definition.string.end.xml
pop: true
- include: scope:text.cloze
Save this in Packages/User/XML (Cloze).sublime-syntax
This will result in:

Good luck!