What is the correct way to have a field that conta...
# advancedpdf
s
What is the correct way to have a field that contains HTML interpreted as HTML by Freemarker? I have a field that contains tags, such as:
<small>Tier 1: 0<br />Tier 2: 100</small>
s
try this
record.myfield?replace(">", ">")?replace("<", "<")?interpret
👀 1
n
I think there is ?html as well.
s
@Selcuk Dogru doing just:
record.memo?replace(">", ">")?replace("<", "<")
worked perfectly (no need for interpret). No idea why the no escape directives don’t work, it would have been much more simple that way, but glad something did. Thank for the great suggestion!
I wrapped it in a function, for convenience:
Copy code
<#function unescape html_text>
  <#return html_text?replace(">", ">")?replace("<", "<")>
</#function>
...
${unescape(record.memo)}
s
I remember a use case I needed interpret (maybe new lines or something else) but glad to hear it worked for you