I'm using freemarker to generate a freemarker template. But I need some way to escape freemarker tags.
How would I escape a <#list> tag or a ${expression} ?
I'm using freemarker to generate a freemarker template. But I need some way to escape freemarker tags.
How would I escape a <#list> tag or a ${expression} ?
You can use raw string literals to escape expressions and <
/ >
to escape directives:
${r"${expression}"}
<#list>
will print
${expression}
<#list>
I'm using the alternative syntax feature. I start the template with [#ftl] and use this syntax.
For the expressions I use the string literal feature: ${r"${expression}"}