Description
Current Behavior
With my previous experience working with templating stuff, the evaluation of values should only happen between {{ }}
, and outside the {{ }}
should remain untouched/unchanged, however it is not the case in configu.
For example I have a file back-tick.txt
, its content is just
`
Run configu eval | configu export --template examples/back-tick.txt
it will give
configu eval | configu export --template examples/back-tick.txt
│
◇ Configs evaluated successfully
│
■ template expression evaluation failed: Error: Failed to evaluate expression "````"
│ "" is not a function
which it is expected to just give
`
Currently we need to prepend \
before to give the expected content, which is counter intuitive.
Another example is \n
For example we have a line-break.json
{
"title": "Hello",
"paragraph": "{{$.configs.MESSAGE.value}}\nIt is a nice day"
}
configu eval | configu export --template examples/line-break.json
it gives the following, which breaks the json syntax
{
"title": "Hello",
"paragraph": "Hi there!
It is a nice day"
}
which I expect it gives the following instead, that does not evaluate the line break character
{
"title": "Hello",
"paragraph": "Hi there!\nIt is a nice day"
}
Now I need to add extra \
to avoid \n
being evaluated, which is not supposed to be a templating engine's behavior
{
"title": "Hello",
"paragraph": "{{$.configs.MESSAGE.value}}\\nIt is a nice day"
}
Expected Behavior
it is in above
To Reproduce
No response
Context
No response