Open rbecheras opened 6 years ago
I believe you should be able to escape the template by doing \${foo}
. I'm not sure if that will work, let us know either way and we'll go from there.
(fwiw, I get all of the notifications from GitHub, feel free to tweet as well, but it's just a duplicate notif to me. I saw a bunch of the notifs while I was on vacation, I'm back now. Sorry for the delay)
edit: btw this template-escaping issue has been one of the most frustrating aspects of doing these templating libraries. there are so many scenarios like this where different syntaxes collide in some way, or where users need to do documentation for templates but they don't want the templates inside markdown fences to be rendered, etc. There are several ways we can work around this, I just need to know more about your build and if that suggestion I gave worked.
Hi Jon!
Sorry for the duplicated notifications, it's noticed, github notifications are fine.
Sorry too I forgot to mention I already tried \${foo}
and it don't work, it behave exactly like ${foo}
.
Hi Jon,
For now I use a workaround but let me know what you think about it:
We can update the regex to allow templates to be escaped. However, if you need to render those escaped templates at some other point in the process, you will need to unescape them first. I'll take a look at the regex and see what needs to be done.
I use
Generate
to create my own generators andengine
as template engine.When in a template I have a line including a template string (
${myVar}
),engine
seems trying to find themyVar
value to inject it in the template.But here I'm generating a file containing some template strings like in es6 template strings of bash template string.
See below:
As you can see, here the template for the generating file
.gitlab-ci.yml
include the following line:But I need this line to be unchanged after the template have been rendered.
${myVar}
in aengine
template ?${myVar}
and<%= myVar %>
equivalent ?