T
Task3y ago
Rots

Escaping templating - colon space is special in yaml

# https://taskfile.dev

version: '3'

tasks:
demo-ok: echo '{{`a:b`}}'
demo-fail: echo '{{`a: b`}}'
demo-alt-ok: "echo '{{`a: b`}}'"
# https://taskfile.dev

version: '3'

tasks:
demo-ok: echo '{{`a:b`}}'
demo-fail: echo '{{`a: b`}}'
demo-alt-ok: "echo '{{`a: b`}}'"
Notice the space difference between first and second case causes a failure. The failure seems to happen at parse time, how come yaml parser is confused?
1 Reply
andreynering
andreynering3y ago
Hi @Rots, sorry for the long time to respond. This is simple an YAML parse issue. Sometimes it key confused when you have special characters like : or others. The solution is simply what you did on your third example: wrap in quotes.

Did you find this page helpful?